Saturday, June 18, 2005

Lifetime of persistent FormsAuth Cookies

A student asked me about the expiration time of the .ASPXAUTH cookie if you call FormsAuthentication.RedirectFromLoginPage(name, true).

This is not really new info, but i double checked on .NET 2.0 B2 - and tracked down the following line of code in System.Web.Security.FormsAuthentication.GetAuthCookie():

FormsAuthenticationTicket ticket1 = new FormsAuthenticationTicket(2, userName, DateTime.Now, createPersistentCookie ? DateTime.Now.AddYears(50) : DateTime.Now.AddMinutes((double) FormsAuthentication._Timeout), createPersistentCookie, string.Empty, strCookiePath);

 


Work in Progress
6/18/2005 8:19:50 PM UTC  #  Comments [0]