检查所有其他站点后,无法设置会话超时

时间:2012-03-13 23:22:03

标签: asp.net asp.net-ajax

在web.config中添加这些设置以增加会话超时后:

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
 stateNetworkTimeout="240" cookieless="false" timeout="240"></sessionState>

<authentication mode="Forms">
   <forms name="site" loginUrl="login.aspx" timeout="9999999" 
    slidingExpiration="true" protection="All" cookieless="AutoDetect" 
    requireSSL="false" enableCrossAppRedirects="true" defaultUrl="default.aspx"> 
   </forms>
</authentication>

但我的网页会话总是在20分钟后结束。我错过了什么?

提前致谢。

2 个答案:

答案 0 :(得分:1)

我在这里找到答案:http://www.primaryobjects.com/CMS/Article86.aspx通过添加iFrame并在会话结束前打开网页。

答案 1 :(得分:0)

  

我错过了什么?

IIS可以随时回收您的应用程序域。例如,在一段时间不活动之后,IIRC默认为20分钟。或者,如果应用程序达到某个内存使用限制或CPU阈值。所有这些都可以在IIS中的应用程序域属性中进行配置。当然,当IIS回收你的AppDomain时,你可能存储在内存中的所有东西(例如会话)都会被遗忘。