We are setting auth cookie as follows:
var authTicket = new FormsAuthenticationTicket ( 1, principal.Email, DateTime.Now, DateTime.Now.AddMinutes(1200), false, JsonConvert.SerializeObject(principal), FormsAuthentication.FormsCookiePath ); var enTicket = FormsAuthentication.Encrypt(authTicket); var cookies = new HttpCookie(FormsAuthentication.FormsCookieName, enTicket) { Expires = DateTime.Now.AddMinutes(1200) }; response.Cookies.Add(cookies);
This cookie expires in 10 mins. Windows log viewer says:
Event code: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied was invalid.
Any ideas what can happen and how to fix that?