Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 86804 invoked from network); 24 Sep 2000 14:10:42 -0000 Received: from neodymium.btinternet.com (194.73.73.83) by locus.apache.org with SMTP; 24 Sep 2000 14:10:42 -0000 Received: from [62.7.34.182] (helo=bagpuss.pyrites.org.uk) by neodymium.btinternet.com with esmtp (Exim 3.03 #83) id 13dCUF-0006gw-00 for tomcat-user@jakarta.apache.org; Sun, 24 Sep 2000 15:10:40 +0100 Received: by bagpuss.pyrites.org.uk (Postfix, from userid 1000) id 05CFA7D29; Sun, 24 Sep 2000 15:10:01 +0100 (BST) To: tomcat-user@jakarta.apache.org Path: not-for-mail From: Nick.Holloway@alfie.demon.co.uk (Nick Holloway) Newsgroups: list.tomcat-user Subject: Re: how to detect a session has no user Date: 24 Sep 2000 15:10:01 +0100 Organization: Alfie's Internet Node Lines: 13 Sender: Nick.Holloway@pyrites.org.uk Message-ID: <8ql1vp$ide$1@alfie.demon.co.uk> References: <200009241529250674.01070182@smtp-server> X-Newsreader: NN version 6.5.0 CURRENT #119 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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/