Session Timeout extend in Asp.Net

雨燕双飞 提交于 2020-01-16 08:29:06

问题


How to extend the session timeout? I tried entering:

Session.Timeout = 720;

In formLoad and also tried in webconfig:

<system.web>
    <sessionState 
     mode="InProc"
     cookieless="true"
     timeout="720" />
</system.web>

But still it times out after 10 minutes. Can anyone help about this issue?


回答1:


Take a look at this Microsoft Technet article. Check if it suits your needs.

<configuration>
  <system.web>
     <sessionState 
         cookieless="true" 
         timeout="20">
     </sessionState>
  </system.web>
</configuration>



回答2:


You might see this article, I haven't used it but a time ago I needed something like this to use in a webservice and I finished with another approach. It could be useful to you:

The Defibrillator: Keeping ASP.NET Session Alive Ad Infinitum



来源:https://stackoverflow.com/questions/2266536/session-timeout-extend-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!