Howdy,
Why not to this via a session listener?  It's trivial.  Keep a static
map with the session Id (String, key) and creation time (long, value).
Add a value in the sessionCreated event and remove the value, calculate
delta in the sessionDestroyed event.  That's so much cleaner than a
DB-oriented approach.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Andoni [mailto:[EMAIL PROTECTED]
>Sent: Thursday, July 03, 2003 11:11 AM
>To: Tomcat Users List
>Subject: Re: Storing the SessionID in the Database.
>
>Yes, the can.  In fact I am using JSP so I can do session.getID() at
>anytime.
>
>But this does not help me as I want to know how long this session has
been
>active.  I want to be able to store the timestamp for when the session
was
>invalidated by clicking "exit" so as to be able to calculate how long
(on
>average) users spend on my site.
>
>Andoni.
>
>----- Original Message -----
>From: "Shapira, Yoav" <[EMAIL PROTECTED]>
>
>When the user clicks, does it not go to some page in your system?
Can't
>that page just do request.getSession() to get the session and its ID?
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to