When Session ends.

Results 1 to 2 of 2

Thread: When Session ends.

  1. #1
    Join Date
    Dec 1969

    Default When Session ends.

    I would like to pop-up a msgbox when the session ends to ask the user whither or not they would like continue with the session. If they click ok then the session variables are maintained other wise the browser closes. Is this possable?

  2. #2
    Join Date
    Dec 1969

    Default Can't do it that way...

    When the session ends on the server, it simply ends.<BR><BR>The server has NO NOTION of where or what or how it was contacted by a given browser. The HTTP protocol is a stateless protocol, and that includes the fact that the server doesn&#039;t have any way to re-establish a connection to any given client.<BR><BR>What you have to do:<BR><BR>(1) *IN THE BROWSER*, use scripting to set a timeout that will occur sometime *before* you know the session will expire. Say pop up a message window after 15 minutes, if the session will expire in 20.<BR><BR>(2) If the user wants to continue the session, then you&#039;ll have to *SOMEHOW* make a round trip to the server USING THE SAME SESSION. That will refresh the session timeout.<BR><BR>How do you make sure you are using the same session? You can&#039;t do the refresh via the popup! It&#039;s quite legal for a browser to use different sessions for each window, including popups.<BR><BR>You *could* use a 100% hidden frame and just have it submit a dummy form to a dummy ASP page. Multiple frames in the same frameset should always be using the same session.<BR><BR>*********<BR><BR>Now what happens if you pop up the message window after 15 minutes and the user is on coffee break and doesn&#039;t come back for another 15 minutes??? Can you say "oops"?<BR><BR>I would recommend that if you get no answer within 4 of those remaining 5 minutes that you go ahead and force the session refresh anyway and popup a different message telling the user you have done so.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts