For each user session add a datestamp at the session creation.  For each
subsequent request that uses an existing session check the datestamp
against the current time.  If the difference has exceeded your max session
timeout send the user to a relogin page that contains the message using the
RequestDispatcher to forward the request to your destination relogin page:

RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/relogin.html");
dispatcher.forward(request, response);

Also why the use of a bean when the HttpSession object should do the trick
for you?

Hope that helps.

Cory  


At 09:18 PM 8/20/00 -0500, Todd McGrath wrote:
>
>The site I'm working has a custom login component where users must have
>a valid username/ password combination.  I would like to redirect or
>present a user with a message when a Http session timeout has
>occurred.   You know, "your session has expired, so you must re-login"
>message or something similar.  
>
>I'm in the beginning stages of the code.  So far, the app stores certain
>information about the user in a http session Java Bean, so I'm thinking
>of checking for the existence of this bean in a Controller servlet to
>determine if the Http session has timed out:  
>
>if (javabean == null) {
>  String message = "Your session has timed out, please login again";
>  
>}
>else ...
>
>
>Any opinions on this?  (including other, better ways to achieve this
>functionality)
>
>-Todd
>
>

Reply via email to