tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barclay A. Dunn" <barc...@happypuppy.com>
Subject active session counting, redux
Date Thu, 07 Aug 2003 16:55:48 GMT
hi,
 
i have grown my own active session counting set up and it is definitely
*adding* sessions to the count, but i do not think it is ever removing
them.
 
here is my configuration:
 
1. i have an object called SessionCount that contains a HashSet of
session ids, and methods to add, remove, count, and list elements in
that HashSet.
 
2. i have a user object that gets bound to the session, so i caused that
user class to implement HttpSessionListener. Its sessionCreated() and
sessionDestroyed() methods execute SessionCount.addSession(sessionId)
and SessionCount.removeSession(sessionId), respectively.
 
3. i have this in my web.xml:
    <!-- this listener causes the session expiration to become known to
the HPUser object in session -->
    <listener>
        <listener-class>com.happypuppy.util.HPUser</listener-class>
    </listener>

first of all, bearing in mind TIMTOWTDI, and that this is the way i've
chosen *for now*, does this look right? 
 
i've confirmed that it's not adding multiple entries for the same
session id, but on my dev server, where i *think* i am the only user, it
thinks there are 3 active sessions. this is after logging out, at which
point the session is manually destroyed, and logging back in.
 
TIA,
 
Barclay A. Dunn
Senior Developer
www.HappyPuppy.com
33-41 Newark St, #1A
Hoboken, NJ  07030
201-269-6302


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message