locked
How to call Session_End method?? RRS feed

  • Question

  • User-1587907100 posted

    I have an application Im using Session to store the Login and Logout info...

    but my Seesion_End event is not getting raised.

    If I stop the server at that time it will end all the sessions i started..

    I set the Sesssionstate as InProc in Web.Config tooo..

    But still its not working when i close the browser..

    When I close the browser how can i call it?? or am i missing any thing?

    Tuesday, September 13, 2011 4:22 AM

Answers

  • User-1199946673 posted

    But still its not working when i close the browser

    It is not supposed to! The session end automatically after the amount of minutes (default 20) of inacticity set in the TimeOut property

    http://msdn.microsoft.com/en-us/library/ms178581.aspx

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 14, 2011 3:28 PM
  • User465171450 posted

    It's not going to get called when you close the browser. How does the server know you closed the browser? Your browser isn't conneted directly to the server during the entire time. It is only connected while it is getting the html, images, css, etc.. Once it's done the connection is closed. That's why you have a Session object, because the web is stateless and the clients are not connected in a true session. The session will continue regardless of your browser until IIS determines that the session has reached the timeout, the application hasn't been used during a certain period of time, or the application pool crashes or is recycled.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 14, 2011 4:54 PM

All replies