tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Wall <>
Subject Re: TC 6.0.20 - how to know session restored on restart?
Date Fri, 07 Aug 2009 17:12:00 GMT

> I am using Tomcat 6.0.20 and have implemented the SessionListener 
> interface.  We can then use this to show a list of active sessions to 
> our users, and when they are logged in, we even know which user is 
> tied to the session.  This is very handy.
> However, on tomcat restart, all existing sessions are serialized as 
> tomcat stops and then reactivated when tomcat starts.  But I have no 
> way of building my list of active sessions since those that are 
> started do not call the sessionCreated() method.
> Is there any way to get a list of sessions tomcat resumes on restart?

This capability was available back in servlet 2.1 with 
HttpSessionContext.getIds() and getSession(sessionId), which would allow 
me to build my initial list based on the sessions when the system starts 
up.  These are deprecated now.

It seems if I can see all sessions that are started and stopped using 
SessionListener, there should be no reason why we can't get the sessions 
auto-built from session persistence when Tomcat restarts a web app, 
too.  Any tricks to figure this out?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message