Notify User that Session has Timed OUT

Results 1 to 4 of 4

Thread: Notify User that Session has Timed OUT

  1. #1
    Tom Piecuch Guest

    Default Notify User that Session has Timed OUT

    What is the easiest way to notify a user that their session has timed out due to inactivity. I have an application with a long order page and a lot of dumb busy users. They may start to order walk away and come back after timeout. I wanted to alert them immeadiately rather than have them continue making choices on the form and not find out until after they clicked submit.

  2. #2
    Join Date
    Dec 1969
    Posts
    201

    Default RE: Notify User that Session has Timed OUT

    What I did was put a session variable on my form page. Then on the process page on the form I put at the top...<BR><BR>if session("whatever") = "" then<BR> &#039tell the user what you want there session has timed out;<BR> &#039provide a link back to a new session<BR>end if<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    213

    Default RE: Notify User that Session has Timed OUT

    Use JavaScript setTimeout to go to a function<BR>that would rewrite the document to a simple HTML that would<BR>say "You have timed out" along with a hyperlink to your start<BR>page. You could set the timeout to 20 minutes if that is your<BR>asp session timeout value. Or you could set the interval to 5 minutes and have it go to a function that would check to see if <BR>the session cookie has expired. Any activity on the page from<BR>either the keyboard or the mouse would have to reset the timer<BR>if you use the 20 minute option.<BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    1,671

    Default RE: Notify User that Session has Timed OUT

    Yes, I&#039ve done it that way too. But, I think he wants to notify the user immediately when the session times out, so they don&#039t continue filling out the long form, hit submit, and *then* find out.<BR><BR>The following worked for me:<BR><BR>&#060;SCRIPT LANGUAGE=javascript&#062;<BR>function timeoutWarning() {<BR> setTimeout("alert(&#039Your session has timed out&#039)",&#060;%=Session.Timeout * 60000%&#062;);<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR>Just add this function to your BODY onload event:<BR>&#060;BODY onload="timeoutWarning();"&#062;<BR><BR>Good Luck,<BR><BR>Mike


Posting Permissions

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