tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Narayanan Balasubramanian" <kbharish_2...@hotmail.com>
Subject Re : Session Time Out
Date Thu, 01 Jan 1970 00:00:00 GMT
hi  there is no built in function to get the session has timed out or not.

  Follow the steps.
  1. Setting the max interval the session should be valid 
.......session.setMaxInactiveInterval(3600)

  this 3600 = 72 * 1000  milli seconds.

2. fine now u have set the session should exist for 2 hrs

3. Get the time when the page is last accessed

4. Calculate the time difference between when the page is last accsessed and 
when the page is accessed now .

( For getting the page last accessed ...u have session.getLastAccessesTime() 
- This will return when he last acessed the poage )

  u know how many hrs / mins / secs the session should be valid ...just 
subtract the current tiume  from last acesed time ..

  u will get a result .

check the result with the time u have given for session . If it exceeds 
...redirect him .

  Hope this will help

Narayanan.
s.w engineer
Enhancement Technologies
India.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Mime
View raw message