I have an ASP.NET MVC2 application, and I'm using FormsAuthentication to manage the Auth Cookie. When the cookie expires and the page is access, I need to display the Username in the field and the Remember Me checked. How can I do this once the cookie expired and I don't have access to it?
A:
You don't by default. Cookie expired means the client is a full new user to the system.
Possible solution: You might want to set a cookie with an expiration date in 2099 or something, and store the username in there after logging in. When a 'blank' user hits your authentication page, you can check whether the cookie exists, and prefill the username and the remember me checkbox.
Jan Jongboom
2010-09-14 16:12:44