Last post Jun 19, 2019 06:57 AM by AddWeb Solution
Jun 18, 2019 06:37 PMemail@example.com|LINK
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?
Jun 18, 2019 06:48 PM|mgebhard|LINK
Any ideas what can happen and how to fix that?
It could be the application is restarting after 10 minutes and the machine key is configured to auto-generate which invalidates the token. Try setting a specific machine key in the web.config.
Do a Google search and you'll find plenty machine key examples.
Jun 19, 2019 06:57 AM|AddWeb Solution|LINK
Please change the Session timeout to 30 minutes or more and see if the changes in your forms authentication cookie behavior. u can solve your problem
Please Refer Below Link :