问题
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