I need to find the time, in seconds, for which my client is active, and need to store the time in, time out in a databse table. Sessions are the obvious way to do it.
A session is destroyed, when it has reached it's time limit or the client chooses to end his session(logging off).
We can set timeouts in xml or in
servlet. How can we handle explicit logging out performed by the client.
1. sholud we use a separate servlet to handle this, so that we can get the session associated with the client and call the
invlaidate() method on that session object.
2. we have
getCreationTime() to find the time when the session was created. is there a method to find the time when the session was destroyed? there won't be a session to call methods on when it has been destroyed, but i still have that doubt, is there a method?
can we use
HttpSessionListener's
sessionDestroyed(HSE e) method(create a Date and pass it to a model, to store the date in a database table).
Have nice day
krishna prasad