问题描述
我在web.config文件中将会话时间设置为9小时,如下所示:
I have set session time out to 9 hours in web.config file something like this:
"<sessionState mode="InProc" timeout="540" />
但是,用户经常抱怨他们在不到9个小时的不活动和时间间隔内面临超时超时之后也会有所不同。
But often users complain that they are facing time out in less than 9 hours of inactivity and the time interval after they are timed out also varies.
我想知道会话超时是否依赖于IIS中的以下任何设置:
I was wondering if session time out is dependent on any of the below settings in IIS:
- 会话时间设置
- 应用程序池的空闲超时设置
- 回收设置。
请告知。
另外,如何在IIS 7.0中检查会话超时设置?
Please advise.Also, how do I check session time out setting in IIS 7.0?
推荐答案
当会话将丢失时ApplicationPool回收。这是您提到的IIS设置之一。仅在web.config中设置超时是不够的。您需要在IIS中调整设置。
The session will be lost when the ApplicationPool recycles. That's one of the IIS settings that you mentioned. To set only the timeout in the web.config will not be enough. You need to adjust the setting in IIS.
这是我在调查同样的问题时找到了。
Here is a link I found while I was looking into the same problem.
此外,这个问题非常有用:
Also, this question was very useful: Losing Session State
这篇关于ASP.Net中的会话超时设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!