tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick.Hollo...@alfie.demon.co.uk (Nick Holloway)
Subject Re: how to detect a session has no user
Date Sun, 24 Sep 2000 14:10:01 GMT
mlintner@flash.net (Mark Lintner) writes:
> I list logged in users in a db table. When they log off they are removed.=
>  How can I detect the case where they have closed the browser without=
>  logging off so that I can remove them from the db??

Store an an object that implements HttpSessionBindingListener into the
session.  Tomcat will call the valueUnbound() method on the interface
when the object is removed from the session, which happens automatically
when the session expires or is invalidated.

-- 
 `O O'  | Nick.Holloway@pyrites.org.uk
// ^ \\ | http://www.pyrites.org.uk/

Mime
View raw message