Fire Session_End in Global.asax
-
I am trying to update an application object in THe Session_End Sub but it does not seem to work. If I close my browser it does not fire. Also, if I open the app again the value does not start at 0 again. Am I missing something? Why does the application object stay around after my browser was closed? Why doen't the Session_End fire when I close my browser? Thanks
-
I am trying to update an application object in THe Session_End Sub but it does not seem to work. If I close my browser it does not fire. Also, if I open the app again the value does not start at 0 again. Am I missing something? Why does the application object stay around after my browser was closed? Why doen't the Session_End fire when I close my browser? Thanks
Closing the browser window isn't equal to close/end the session. If you do close the browser window, no information is send to server, and as HTTP is stateless and connectionless, server do not know if the client (browser window) exists or it's been closed. So the user's session object will be close after it timeout's. There's no easy way to inform the server when user closes browser. The best way is to create some logout / end button which'll destroy the session and do all cleanup things (otherwise it'll exists until timeout occurs). -- Mariusz 'mAv' Wójcik master e-software engineer (BPC)