Tuesday, September 18, 2007

ASP.NET Login Control Remember Me Doesn't Work

I recently did a quick Google search for an issue I was having with the ASP.NET login control where the Remember Me feature of the control appeared not to be working as I had expected. I found a few hits on Google Groups where users were experiencing the exact same symptom, but nobody was getting an answer to their question.

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">

Hope that helps...

No comments: