Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Timout events

Status
Not open for further replies.

ukwebsite

Programmer
Dec 9, 2000
82
GB

Please help.

I have a login screen that creates a session i.e.

session("ID") = objRS("ID")
Session.Timeout = 5

How do i make it that if they leave the page for longer than the session time ie 5 minutes it will redirect them to another page to log them out.

Whats the point in putting a timeout on the session if this cannot be done.


Matthew Wilde
matthew@ukwebsite.com
 
Whats the point in putting a timeout on the session if this cannot be done"

this absolutely can be done. if you want it to happen immediately upon the session timing out, you'll need to incorporate javascript to run a timer that changes the page's location after 5 minutes. alternatively you can use a meta refresh to reload the page every five minutes, and catch a timeout with the passive way below:

the passive way is to store the current session id elsewhere, in a cookie or database or similar, and upon each new page request check the current session id with the stored one. if they don't match, redirect to your timeout page.



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top