how to clear sessions in java while closing the window

Dear all,When I am closing the window if I click 'x' on window how to handle that event in java script , or any other way for this event handling.Sudheendra.
[180 byte] By [sudheendraa] at [2007-11-27 5:59:15]
# 1
well, there is a way ... but this isn't really 'java', it's javascript.and it's generally annoying if you do implement this.
prob.not.sola at 2007-7-12 16:35:33 > top of Java-index,Java Essentials,Java Programming...
# 2

it's not necessarily a good idea to clear a session when the user close the browser window

imagine the user has many windows opened over the same website

if you invalidate the session by closing one of the windows, this means the user will have to log to the website once again when he switches to the next windows, to reinitialize his session

calvino_inda at 2007-7-12 16:35:33 > top of Java-index,Java Essentials,Java Programming...
# 3

Thank you very much ,

In my application for each login i am using different sessions.

In one login if a user navigating then there is no chance of opening different windows.

So when the user without clicking logout button , if he closes the window by clicking 'x' , then the session allocated for this login is retaining until the session time out.

so i want to invalidate the session for this particular login .

Thank you,

Sudheendra.

sudheendraa at 2007-7-12 16:35:33 > top of Java-index,Java Essentials,Java Programming...
# 4
maybe you should take a look to the "onunload" event
calvino_inda at 2007-7-12 16:35:33 > top of Java-index,Java Essentials,Java Programming...