Can a FormsAuthenticationTicket survive an app pool recycle?

不羁的心 提交于 2020-01-01 10:29:30

问题


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:


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



来源:https://stackoverflow.com/questions/3676995/can-a-formsauthenticationticket-survive-an-app-pool-recycle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!