一个可以生存的FormsAuthenticationTicket一个应用程序池回收? [英] Can a FormsAuthenticationTicket survive an app pool recycle?

查看:164
本文介绍了一个可以生存的FormsAuthenticationTicket一个应用程序池回收?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个解决方案,我们可以做一个的FormsAuthenticationTicket(以及相应的cookie)有很长的保质期。这可以通过设置一个较高的值或使用滑动过期,但该网站的应用程序池被回收时,该的FormsAuthenticationTicket消失(我认为),该cookie将失效并要求用户重新登录。

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?

推荐答案

设置静态 MachineKeys的而不是自动生成的。这样,的FormsAuthenticationTicket 将生存的应用程序池回收。

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

这篇关于一个可以生存的FormsAuthenticationTicket一个应用程序池回收?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆