Avonelle's Tech Blog

Go Back

Why Remember Me Isn't Working

Today I solved a problem I was having with ASP.NET's membership provider and the "remember me" option for logging in. The problem was basically that if the user checked the "remember me" checkbox, during log-in, then closed their browser and re-opened the site, they were taken to the log-in page again. Thus, it appeared that the remember me option wasn't working.

It was.

The real problem was that the page "login.aspx" had been added as the default document in IIS. So, if the user didn't specify a page when they went to the site, login.aspx was loaded, and it looked like remember me wasn't working.

The solution was to remove login.aspx from the list of default documents in IIS. We also had to change the web.config so that the loginUrl attribute for the forms tag referenced login.aspx with a tilde (loginUrl="~/login.aspx").

This is a fairly obvious answer, but since I didn't find it when I was trying to resolve my problem, I'm adding it for the next guy.

Posted by Avonelle on Sunday, September 21, 2008.

Facebook Twitter