Chad,

I am doing something very similar...

Are you implementing the HttpSessionBindingListener interface in your
object?  If not, try implementing this interface in your object that is
placed in the session.  This will throw a 'valueBound' event when the object
is placed in the session and a 'valueUnbound' event when removed (either
explicitly or by timeout).  The valueBound method will increment the count,
and the valueUnbound method will decrement it.  Works perfectly for me.

Also, you might want to use session.invalidate() rather than explicitly
removing the session objects-- I found it was easier to manage.

HTH,

Mike


 

-----Original Message-----
From: Chad LaJoie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 10:25 AM
To: [EMAIL PROTECTED]
Subject: Session timeouts


         I have been experiencing some problems with sessions timeouts.  It 
seems that they are not unbinding all my sessions attributes.  For 
instance.  I have a session tracker object that gets bound to a user's 
session when they log in.  This  simply adds 1 to an application level 
attribute indicating the number of people who are currently logged 
in.  When the user's logs out I call session.removeAttribute("tracker"); 
explicitly and the attribute is unbound.  This decrements the application 
attribute by 1.  This all works fine.  However if the session actually 
time's out the tracker object doesn't seem to be unbound.  I.e. my little 
session tracker program still show the user as loged in.
         Has anyone else encountered this problem, and if so is there a 
solution for it?

Env:
         Tomcat 3.2.1
         Sun JDK 1.3.0_1
         Apache 1.3.19
         Solaris 8

Chad La Joie                           "Only a man who can not conquer
IT Specialist                             his deficiencies feels the need to
IS&C - WARD                             convince the world he has none"

Mike Bryant (E-mail).vcf

Reply via email to