locked
End session on browser window close RRS feed

  • Question

  • User1557826304 posted

    Hi

    I am working on an application which uses forms authentication.

    When the user closes the browser window, the session should be destroyed. But its not.

    When I open the browser and run my application, session is alive. Why is it like that?

    thanks

    Monday, April 6, 2009 7:59 AM

Answers

  • User-1679385778 posted

    It may be due to cookies! Check the expiration time of cookies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 6, 2009 9:03 AM

All replies

  • User-1679385778 posted

    It may be due to cookies! Check the expiration time of cookies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 6, 2009 9:03 AM
  • User312158796 posted

    Remember that HTTP i a disconnected protocol.  Your web server has no knowledge of your browser except when a request is actually taking place.  Sessions are controlled (usually) by cookies which identify the browser to the server, but the server has a default session timeout.  Only after the session timeout has expired (usually 20 minutes after the last request) will the session be closed.

    If you want to close a session you can via code on the server, for example you could have a "Sign Out" button and in the event handler run a Session.Close() method.

     

    Monday, April 6, 2009 9:20 AM