Link to home
Start Free TrialLog in
Avatar of agsingh
agsingh

asked on

Calling Logout on closing my browser window

want to call my logout servlet if someone hits browser close button.
I tried all javascript combinations with onUnLoad() window.close() etc but nothing wrks as these events gets fired even on refresh and changing the locationof the url.

I was giving up when i saw the implementation in citibanks website. If anyone has account with citibank then u can check it out.
I tried to look into the view source but coulnd't make out anything..

any ideas will be highly appreciated ..!!!
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

One way to do this is to use frames with all of your pages in the site contained within one master frame. You only call the logout script when the frame is closed.

Fritz the Blank
Avatar of agsingh
agsingh

ASKER

i already have my application running. I cannot implement frames now.
That is the only way that I know how to do this.

Fritz the Blank
Avatar of agsingh

ASKER

Is there any way i can catch only browser close ie some javascript that works only when browser is closed and never in other case.
ASKER CERTIFIED SOLUTION
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: fritz_the_blank {http:#8212592}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer