Click to See Complete Forum and Search --> : Browser Close Event !


cup_of_java
09-26-2003, 05:40 PM
I want to catch brower closing events from clients so that i can send a request to server to invalidate clients Sessions on the close operation.
How can i do that ? :confused:
somthing like: :rolleyes:
Body onClose="window.open( 'invalidate.jsp' );"
???
any helps would be appriciated :)

Khalid Ali
09-26-2003, 06:08 PM
I don't think that will work( or you ca ncount on that solution).
What happens is when a onclose/onunload event is triggered,it does not give any time for browser to execute any other commands.

I see you are using Java,what you can do is keep the session timeout time to a general time limit that will solve this issue

cup_of_java
09-27-2003, 07:06 AM
I use 10 min for my session timeout. That's Ok.
but since in this system, There would be just one login with any Username, ( ie: system won't accept a logged on username ) and this prevents dual-login.
when somebody ( with any fault or ... ) closes his window, he should wait for 10 min to re-login to system.
i want this event to invalidate the session. :(
i hope i'd clarify the main problem.

Khalid Ali
09-27-2003, 08:57 AM
It may sound,not very nice, but to make a solution thats dependable you will have to ask your users to click a button to logout on the page(sending an explicit request to the server to invalidate the session object)