Session_OnEnd Event Not Firing
Posted on 2014-02-25
We currently have a web app that times out after 20 minutes as intended. When this occurs I want to display a message box telling the user that the session has timed and out an to click OK to refresh the page.
I have the following VB code on the back end:
Partial Class _Default
Public Event OnEnd As EventHandler
Public Property Timeout As Integer
Public Sub Session_OnEnd()
MessageBox.Show("Your session has timed out. Click OK to refresh your page.", _
Dim result As Integer = MessageBox.Show("message", "caption", MessageBoxButtons.OK)
If result = DialogResult.OK Then
And for testing purposes I’ve set the following entries in the web.config file to 1 minute for testing:
<sessionState mode="InProc" cookieless="false" timeout="1"/>
<forms loginUrl="~/Account/Login.aspx" timeout="1"/>
The problem is that the event doesn’t seem to fire. I’m going into debug, executing one search and leaving the page alone, the nothing is happening. What am I missing here?