Auto Timeout

Results 1 to 2 of 2

Thread: Auto Timeout

  1. #1
    Join Date
    Dec 1969

    Default Auto Timeout

    hi,<BR><BR>Just wan to find out using Session variables, can i check if a page is still active? If there&#039;s no activity, 20mins later, the user will be automatically logout and redirect to another page?<BR><BR>On the page itself, i run a while loop to check the session.timeout value and redirect when necessary?<BR><BR>Is my approach right? IS there any other better way to do it

  2. #2
    Join Date
    Dec 1969

    Default RE: Auto Timeout

    The best way is to do something like this:<BR><BR>&#060;script&#062;<BR>function redirect(){<BR> top.location.href="/myPage.asp";<BR>}<BR>window.setTimeout("redirect() ", 1000 * 60 * &#060;%=Session.Timeout-1%&#062;);<BR>&#060;/script&#062;<BR><BR>What that&#039;ll do is call the "redirect" function as the session is about to time out (close enough for government work anyway). You can log them out or whatever using the "myPage.asp" page...<BR><BR>Yeah...?<BR><BR>Craig.

Posting Permissions

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