In my web.config I have this:
<system.web>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" protection="All" path="/" timeout="30"/>
</authentication>
<sessionState timeout="20" />
</system.web>
<location path="admin">
<system.web>
<authorization>
<deny users="*"/>
<allow users="admin"/>
</authorization>
</system.web>
</location>
I have two problems:
In my admin path I want only the admin user to have access but I can't find a way to do this. How can I make only the admin user have access?
The user always gets logged out even if I try to use cookies so he shouldn't be logged out. In my login.aspx I have the folloing code when the user is valid:
FormsAuthentication.RedirectFromLoginPage(user, CheckBoxPersistCookie.Checked);
How can I make the user to stay logged in?