I am setting up the authentication cookie in c# as persistent and with an end date of one year from now, but it expires not too long after being set. The code is below...
DateTime endDate = new DateTime();
endDate = DateTime.Now.AddYears(1);
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
username,
DateTime.Now,
endDate,
true,
userId.ToString(),
FormsAuthentication.FormsCookiePath);
string encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie authCookie = new HttpCookie(
FormsAuthentication.FormsCookieName,
encryptedTicket);
authCookie.Expires = endDate;
Response.Cookies.Add(authCookie);
Any ideas?