Redirecting when Sessions Expire

Results 1 to 5 of 5

Thread: Redirecting when Sessions Expire

  1. #1
    Join Date
    Dec 1969

    Default Redirecting when Sessions Expire

    How can I automatically redirect when my users get the Warning: Page has Expired? I do know that this is when the session varaibles expire after their 20 minute Session.TimeOut default. I would like to redirect the user to my personal page saying that you have been idle for 20 minutes with a link to log back in again. Can anyone help?

  2. #2
    Linda Pyrc Guest

    Default Just one suggestion

    The way that I have handled it is to:<BR>1. Pass every hyperlink through a security.asp (or passthrough.asp if you like). This asp will accept a URL and test that the session is current by testing a session variable that always has a value (or not if session has ended) and then redirecting either to the passed URL if session is still current or to a refresh.asp that will display a brief warning and push them onto the log in screen.<BR>2. Seen as I use standard includes for my top and left navigation I have standard code in there that agail will detect wether the session is active or not and redirect the user to the refresh.asp if the session has ended.<BR><BR>This is the way that I have handled it but if anyone has any better ideas please let me know.<BR><BR>

  3. #3
    sumukh Guest

    Default RE: Redirecting when Sessions Expire

    There is one simple method to this..Since default session is of 20 min you can implement the code as given below.<BR>&#060;% if session("variable") = "" then %&#062;<BR>&#060;script language="javascript"&#062;<BR>alert("This window is closing. If asked for yes or no, please select yes.");<BR>window.close();<BR>;de sired file name.asp?msg=Your session has been expired. Please login again.&#039;,&#039;_blank&#039;,&#039;scrollbars=n o,width=395,resizable=no,height=285&#039;); <BR>&#060;/script&#062;<BR>&#060;%end if%&#062;<BR>

  4. #4
    Alzogbi Guest

    Default RE: Redirecting when Sessions Expire

    But where can we implement this suggested code ? is it in the top of every page ?

  5. #5
    Join Date
    Dec 1969

    Default RE: Redirecting when Sessions Expire

    This is what we have done in our website<BR>We do this only after after he has logged into the site....<BR><BR>We have an include file in all pages(this is easy since we have common header page for all sites ,we just have to chnage at one of the includes)...In that file there is a javascript which starts a timer and after 17.5 minutes we open a new popupwindow using javescript from the parent window which says if u don&#039;t click on the link here in 2.5 minutes,u will be logged out of site...To show the remaining time as a count down clock we use javascript..Once remaining time is zero we take him back to the login page again from the same javascript function...<BR>And this scheme was 100% successful for our 70 b2b sites<BR><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