First of all, I knew that the login control called the FormsAuthentication.SetAuthCookie() method to save the cookie, so I figured it must have something to do with the cookie expiring sooner than I wanted. Knowing that, I looked at the details of the cookie and noticed that it was set to expire 30 minutes in the future. So I did another quick Google search and found a great article on Forms Authentication. Sure enough, there is a section in web.config that is used to configure the authentication cookie, one of which is the timeout. I'd recommend reading that article, first, but this is the authentication section from my web.config with the cookie timeout configured for 30 days.
<authentication mode="Forms">
<forms
loginUrl="Login/Login.aspx"
name=".ASPXFORMSAUTH"
protection="All"
timeout="43200"
requireSSL="false"
slidingExpiration="true"
cookieless="UseCookies"
enableCrossAppRedirects="false"
/>
</authentication>
Hope that helps...
No comments:
Post a Comment