Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Detecting time left in Session

Posted 10 Jun 2002 17:56:34
1
has voted
10 Jun 2002 17:56:34 aegis kleais posted:
Is there quick code that'll let me show how much time is left in the user's current session before the server auto-expires it? How do I set the session timeout locally? My host has set the timeouts to 10 minutes (so that resources on the server can stay open and fast)

I think it's a pain in the arse and all, but if I can show the user how much time they have left before a session auto expire, it'd be nicer then to have their session expire and them think "WTF?!?!"

Replies

Replied 10 Jun 2002 18:29:39
10 Jun 2002 18:29:39 Owen Eastwick replied:
Try:

<%
response.write("<p>"
response.write("Default Timeout is: " & Session.Timeout & " minutes."
response.write("</p>"

Session.Timeout=30

response.write("<p>"
response.write("Timeout is now: " & Session.Timeout & " minutes."
response.write("</p>"
%>

Source: www.w3schools.com/asp/asp_ref_session.asp

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 10 Jun 2002 18:35:23
10 Jun 2002 18:35:23 aegis kleais replied:
Excellent!

My thanks!
Replied 10 Jun 2002 22:36:49
10 Jun 2002 22:36:49 David Behan replied:
Owen,

You don't have an answer to the first part of that question do you?

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Is there quick code that'll let me show how much time is left in the user's current session before the server auto-expires it? <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Just a matter of interest cause I am trying to work it out in my head. I was thinking:

If you framed the site upon loggin and set a javascript timer to count down from 20 minutes until 0. So no matter what page the user goes to the timer countdown would always be displayed. Upon reaching 0 redirect them to another page with the option of logging back in.

Logically... does that work?? My logic is out the window today!!

Regards,



_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replied 10 Jun 2002 23:19:31
10 Jun 2002 23:19:31 aegis kleais replied:
Actually, if you wanted to use javascript to keep the Timeout active, it would be best to have it call the server 2-3 minutes before the session is approximately about to expire rather then RIGHT when it does....

Reply to this topic