You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Ganyo <sc...@eTapestry.com> on 2002/08/13 20:37:32 UTC

Tracking active sessions over a restart?

I'm confused over the appropriate way to track user sessions across restarts
of the servlet engine.  I've been using SessionListeners and
AttributeListeners to track the status of user sessions in my application,
but I've found them to be unreliable when I restart Tomcat and persistent
sessions are enabled.  Is there a way to ensure that I can track the correct
list of active sessions regardless of restarts, etc?

Thanks,
Scott

Re: Tracking active sessions over a restart?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 13 Aug 2002, Scott Ganyo wrote:

> Date: Tue, 13 Aug 2002 13:37:32 -0500
> From: Scott Ganyo <sc...@eTapestry.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "Tomcat-User (E-mail)" <to...@jakarta.apache.org>
> Subject: Tracking active sessions over a restart?
>
> I'm confused over the appropriate way to track user sessions across restarts
> of the servlet engine.  I've been using SessionListeners and
> AttributeListeners to track the status of user sessions in my application,
> but I've found them to be unreliable when I restart Tomcat and persistent
> sessions are enabled.  Is there a way to ensure that I can track the correct
> list of active sessions regardless of restarts, etc?
>

Last time I tried it with Tomcat 4.1.5 or so, this did work correctly --
you get a sessionCreated call the very first time that the session is
created, and a sessionDestroyed call when it is finally invalidated or
timed out.  In between, you can create a SessionActivationListener if you
also want to know when the session is swapped out and back in (either
because of a restart, or because your Manager implementation is swapping
out active but idle session).

Are you seeing something different than this?  if so, what?

> Thanks,
> Scott
>

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>