1

Trying to invalidate the session once click on the browser back button as well as browser close using jQuery. How to capture the browser back button event and browser close event? Is there any advantage with respect to javascript?

Any help appreciated.

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
Sathya Elangovan
  • 163
  • 3
  • 14

1 Answers1

1

Hopefully this helps you:

http://api.jquery.com/unload/

The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

Tom Beech
  • 2,289
  • 1
  • 21
  • 25