问题描述
我用IIS7 ASP.NET网站,在web.config中我有:
I use ASP.NET website on IIS7 where in web.config I have:
<sessionState mode="InProc" timeout="20"></sessionState>
但会议并没有保持20分钟,它的工作原理很奇怪,有时到期1分钟或更少,有时只是重定向到其他页面。我需要使用模式=InProc方式。
But session doesn't keep 20 minutes, it works very strange, sometimes 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!
推荐答案
如果您有抛出未处理异常的应用程序,该应用程序可以回收再利用。或者,也可能因为即使刚刚从IIS中设置错误的内存pressure或回收。这将导致你失去会话。你可以把一些日志记录code在Application_End事件处理在Global.asax中,以检查此条件。
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.
这篇关于ASP.NET SessionState会超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!