开发者

asp.net: when is the data from session getting lost

I'm wondering if I'm going to store some data into the开发者_Go百科 session is it going to be there while the user is authenticated (using formsauth) or might happen that the data will suddenly go null


It depends where you save the session, by default it is saved in Proc mode, which means inside of iis process of this application. Session may be null in this case in two scenarios. One timeout which you set in web.config file or while iis process has been recycled due to low memory or it's own timeout. So i wouldn't count in inProc mode for things you need to keep in session for some time, about 1 minute and more because you don't know when application will be recycled. Try out-of-proc mode. Save session on the same machine not in same process as application.

Good luck

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜