Can a FormsAuthenticationTicket survive an app poo

2019-04-08 08:41发布

I am looking for a solution where we can make a FormsAuthenticationTicket (and corresponding cookie) with a very long expiration period. This is possible by setting a high value or using a sliding expiration, but when the application pool of the website is recycled, the FormsAuthenticationTicket disappears (I think), the cookie gets invalid and the user is asked to login again.

Is there any way around this?

1条回答
对你真心纯属浪费
2楼-- · 2019-04-08 08:53

Set static machineKeys instead of the auto generated. This way the FormsAuthenticationTicket will survive app pool recycling.

查看更多
登录 后发表回答