Reputation: 21091
I'm working on a legacy system that has the following timeout values in web.config.
<sessionState timeout="120" />
...
<forms name="login" timeout="240" />
I also have the following implemented to prevent Null session variable issues. Here's the generic version:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Session("DocNum") = ""
Else
If Session("DocNum") Is Nothing Then
Response.Redirect("~/index.aspx?e=SessionExpired")
End If
End If
End Sub
It appears that the session variable is being cleared well under 120 min setting even though many users are on the system. This seems to be happening regularly.
I've read that the application pool could be causing this but how so? What other configurations and time-out values might be causing this issue?
Thanks for the help.
Upvotes: 3
Views: 1072
Reputation: 3460
If your session state is set to InProc, the recycle settings for the application pool could be resetting the App Pool which clears session. "InProc" means that session is stored in memory, and as a result, any application pool resets would lose what is stored in session. You can check the system event log of the web server to see if there are any events for the application pool recycling due to a regular, recycling schedule or an error.
Upvotes: 3