问题
I'm working on a web project that contains sessions. I have a few pages on the web app: Logon.aspx - If the verification of user is OK, a new session is created:
Pseudo:
If User.connected = True Then
Session("isLogin") = True
Response.Redirect("Content.aspx")
End If
In the “Content.aspx” in the Page_Init event:
If Session("isLogin") = False Then
Response.Redirect("Logon.aspx")
End If
Web.config settings:
<forms loginUrl="~/Logon.aspx" timeout="50" />
<sessionState mode="InProc" timeout="60">
When I run it locally (IIS Express), all works as expected.
However, when I run it on the IIS server, after a few minutes the session resets and throws me to Logon.aspx.
IIS Server information:
I am using IIS 8.5
Idle Time-out (minutes): 60
Regular Time Interval (minutes): 1740
How can I fix this session reset?
P.S.
I have read all your suggestions (until Mar 14 '15).
Also, read all suggestions at session-timeout-in-asp-net), but could not find a solution.
回答1:
I have previously used Application Pool with the settings: .NET v4.5
When I change Application Pool’s settings to .NET v4.5 Classic, the problem stopped!
来源:https://stackoverflow.com/questions/28792488/iis-session-reset