If your talking about what I think you are..which is as soon as the timeout
occurs, not when the user clicks a link and the server can then check for
the "session object", the only way I think you can do it is via an applet
running on the client browser. We did something like this via RMI where we
could send objects to the applet, controlling the applet. This allowed us to
see where each user was on our site, as well as send any to all of the users
messages.

If on the other hand you don't need immediate notice, but instead the next
time the user clicks on a link it redirects them, then there are many ways
to do it. I do it in my JSP header include that is included in every jsp
page. Because not ALL of the links on my site go through a controller
servlet..just forms submitted...the links also need a way to make sure the
user session hasn't expired. Thus, in scriplet code I do something like:

<%
  if( session.getAttribute("LoginFlagObject") == null )
  {
%>
  <jsp:forward page="/relogin.jsp" />
<%
  }
%>

Something like that included in every "inside" page where inside pages are
those that require login to access them.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Todd McGrath
> Sent: Sunday, August 20, 2000 7:18 PM
> To: Orion-Interest
> Subject: http session timeouts
>
>
>
> 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