Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 37465 invoked from network); 9 Jul 2003 01:45:01 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 9 Jul 2003 01:45:01 -0000 Received: (qmail 3973 invoked by uid 97); 9 Jul 2003 01:47:35 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 3966 invoked from network); 9 Jul 2003 01:47:35 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 9 Jul 2003 01:47:35 -0000 Received: (qmail 36013 invoked by uid 500); 9 Jul 2003 01:44:45 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 35979 invoked from network); 9 Jul 2003 01:44:45 -0000 Received: from unknown (HELO camail01.ipcfcdom.inphonic.com) (66.151.154.10) by daedalus.apache.org with SMTP; 9 Jul 2003 01:44:45 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message Subject: RE: How do I determine sessions within Tomcat? MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Tue, 8 Jul 2003 18:44:53 -0700 Message-ID: <9537E22704C8274AAD53C5193A501F0030428D@camail01.ipcfcdom.inphonic.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How do I determine sessions within Tomcat? Thread-Index: AcNFkJ9xlYMGwOiZRGGyzR0SZdF7zgAKmU6A From: "James Courtney" To: "Tomcat Users List" , X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Mark, Another option is to write a callback class that is registered with = each session using the HttpSessionBindingListener interface. Each time = a session is destroyed, either explicitly by the user or implicitly by = Tomcat (user just closed browser) then your widget should have its = valueUnbound method called and you could update your DB. I haven't worked with the SessionListener before but that sounds more = tailor made for the purpose you intend than my solution above. Jamey -----Original Message----- From: Mark W. Webb [mailto:mark@dolphtech.com] Sent: Tuesday, July 08, 2003 1:36 PM To: Tomcat Users List Subject: Re: How do I determine sessions within Tomcat? All you need is the following in your context's web.xml file : my.own.SessionListener there should be an example in the examples context. That is where I got = mine from Turansky, Mark wrote: >ok, I see th session listener interface in the javadocs as well as the = session event class. any advice regarding *how* I plug it into tomcat? = Is your method a standard J2EE solution or will this be Tomcat specific? > >thanks for the quick reply, >mark > > >-----Original Message----- >From: Mark W. Webb [mailto:mark@dolphtech.com] >Sent: Tuesday, July 08, 2003 4:30 PM >To: Tomcat Users List >Subject: Re: How do I determine sessions within Tomcat? > > >you would probably want to write a SessionListener, and plug it into = tomcat. > >Turansky, Mark wrote: > > =20 > >>I am required to track users and their sessions in my web application. = Is there a way to access all the sessions currently held in server = memory? >> >>My application is tracking users in a database table. Upon login, I = log the session id along with a timestamp and other pertinent = information. If the user specifically clicks the "log out" button, I = can update my table with another timestamp, but I assume many will = simply timeout. How do I update my table with their logout timestamp in = the event of timeout? I was hoping to make a simple maintenance thread = in the background that would check existing sessions against my database = table for this purpose. >> >>Thanks in advance, >>Mark >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >>=20 >> >> =20 >> > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > =20 > --=20 Mark Webb Software Engineer Dolphin Technology 474 Phoenix Drive Rome, NY 13441-4911 =09 Phone : 315.838.7000=20 : 315.838.7024=09 Fax : 315.838.7096 Email : mark@dolphtech.com --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org