开发者

ASP.NET SessionState timeout

I use ASP.NET website on IIS7 where in web.config I have:

<sessionState mode="InProc" timeout="20"></sessionState>

But session doesn't keep 20 minutes, it works very strange, som开发者_开发技巧etimes it expires in 1 minute or less, sometimes just redirect to other page. I need use mode="InProc".

Who can help me, what is wrong and how to resolve this problem? Thanks!


If you have an application that is throwing unhandled exceptions, the application could recycle. Or, it could recycle because of memory pressure or even just from the wrong settings in IIS. This would cause you to lose session. You can put some logging code in the Application_End Eventhandler in global.asax to check for this condition.


Application Pool Recycling? (IIS setting).

Anyway, you can detect and handle the timeout in the global.asax (session_end), if that helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜