I am facing a problem due to which my users are logging out frequency while appearing in a Multiple choice online exam.
We have implemented exam on a single page and store the option in view state as users selects the same. On select of next question page is loaded again. Sometime “If Session(“User”) = “”” turns out true and user logs out.
I did setup session on first time page load as
Session.Timeout = 340
Also in web config file session timeout is 2 hours.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("User") = "" Then
Response.Redirect("Default.aspx")
Else
//Processing and updating view state.
Please help by looking into this
Might be the reason AppPool getting recycle. Here are the some causes for that:
Ref:Losing Session State
Solution: use stateserver instead of InProc.
http://msdn.microsoft.com/en-us/library/ms972429.aspx