Following this title, in my web.config, it's generated by VS 2012.
Now, i don't know where i put the below code in web.config through i saw someone put it in <system.web>
but in my web.config it have only <system.web.webPages.razor>
and <system.webServer>
. When i put this code somewhere in web.config I get an error at <authentication mode="Forms">
:
There's code :
<authentication mode="Forms">
<forms loginurl="~/Comfirm/Login" timeout="2880"></forms>
</authentication>
You are putting it in the wrong web.config file. There are two web.config files. one in
Views
Folder and one in the root of the site. put it in thesystem.web
tag of the web.config file in the site rootIf I am not mistaken, VS only makes the tags it will use. Have you tried creating
<system.web>
? It won't auto generate empty sections to the config.in MVC 5 the default value is :
You can notice the Line
Change it to :
And timeout="1440" its Mean one day
You need to add
<system.web>
to the config and put the authentication section within it: