Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Setting and re-setting a time for a session


Message #1 by "Ahmed Barradah" <havana200@h...> on Thu, 19 Apr 2001 11:44:19





 Hi,

   I'm trying to set up a certain amount of time for my sessions and then 

test if the session is timed out or not and reset the Session time 

whenever the user do further activities on the site, but i don't what is 

the best way to do that? 



   Another Question: if I create a file called logout.asp which has 

Session.abandon and say that the user click on the logout link, Will this  

only terminate the session for this particular user or will it terminate 

all the sessions that belong for other users who were loged in at that 

instace? 



 I appreciate any comments or suggesstions!!!



 Thanks 
Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 19 Apr 2001 12:28:09 +0100
You mean you don't want the session to time out when people are using the

application?  



What you are suggesting is unnecessary, because as soon as there is further

activity then the session timeout statrs counting down from the begining

again.  Remember its 20 minutes (or whatever) of inactivity that causes the

session to timeout, so if there is any activity then the session will not

time out.



I prevent the session from timing out in the app I'm working on at the

moment by putting this line into one of the frame pages that remains visible

while the app is being used (if your app does not use frames, then you can

either put this line on every page, or create a hidden frame)



<META HTTP-EQUIV="refresh" CONTENT="<%=((session.Timeout * 60)-10)%>">



this means that 10 seconds before the session is due to timeout, a request

is sent for that ASP again, so the session does not timeout.  The effect of

this is that while the app is open in a window, it will not timeout.  If the

window is closed, then it will timeout as normal.



In answer to your second Q, session.abandon only abandons the current

session, e.g. the session of the user that called it.





-----Original Message-----

From: Ahmed Barradah [mailto:havana200@h...]

Sent: Thursday, April 19, 2001 12:44 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Setting and re-setting a time for a session











 Hi,

   I'm trying to set up a certain amount of time for my sessions and then 

test if the session is timed out or not and reset the Session time 

whenever the user do further activities on the site, but i don't what is 

the best way to do that? 



   Another Question: if I create a file called logout.asp which has 

Session.abandon and say that the user click on the logout link, Will this  

only terminate the session for this particular user or will it terminate 

all the sessions that belong for other users who were loged in at that 

instace? 



 I appreciate any comments or suggesstions!!!



 Thanks 

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com


  Return to Index