• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

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 ..!!!
0
agsingh
Asked:
agsingh
  • 3
  • 2
1 Solution
 
fritz_the_blankCommented:
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
0
 
agsinghAuthor Commented:
i already have my application running. I cannot implement frames now.
0
 
fritz_the_blankCommented:
That is the only way that I know how to do this.

Fritz the Blank
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
agsinghAuthor Commented:
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.
0
 
fritz_the_blankCommented:
I am afraid not. All you can really do is to catch the onUnLoad() event, and that will fire regardless of whether the window was closed, someone moved on to another page, or if the application exits.

Fritz the Blank
0
 
jaysolomonCommented:
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
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now