How to handle HTTP session killing?

Hi,

i have an application in which when one user is logged in ,he is not allowed to login from any other machine.So we are maintaing a database entry for userid with the sessionid. So when ever a usersession is created , we are adding one record into databse with sessionid and all. Similarly when the user logoff or when session is timed out, the user record is deleted from database.I'm using HttpSessionBindingListener for this .But i need to delete records even when the system restarts or reboots or when browser session is killed.But it doesn't happen for me..

is there any way to handle the browser session killing?Is there any methods available in the HTTPSession class.

[715 byte] By [techstudenta] at [2007-10-3 4:21:53]
# 1

> system restarts or reboots or when browser session

> is killed.But it doesn't happen for me..

Well, if nobody sends you a message: why do you wonder that you don't receive one?

Wouldn't the browser session be lost in this case anyway? It'll just time-out eventually, and you're good.

CeciNEstPasUnProgrammeura at 2007-7-14 22:24:08 > top of Java-index,Java Essentials,Java Programming...
# 2

Why not flush all the session records from the database table when the server (or the web-app) starts up?

The proper way to do this is to add a LifecyleListener to the web application.

Your uses aren't going to thank you for such a system, though, because it's so easy to loose a session, maybe without the chance to log out.

malcolmmca at 2007-7-14 22:24:08 > top of Java-index,Java Essentials,Java Programming...
# 3

but what my doubt is , even if the client session is killed the server session still exists and gets timed out,after the time out interval.I have added listeners to check the session time out and delete the records from Database at that time. Then the records should get deleted at least when the session is getting timed out. But that also not happening in my application..

techstudenta at 2007-7-14 22:24:08 > top of Java-index,Java Essentials,Java Programming...