0

I need to detect browser tab close and clear session using AJAX call.

window.onbeforeunload only detects on page reload.

Pupil
  • 23,834
  • 6
  • 44
  • 66
Vijayakumar
  • 53
  • 1
  • 10
  • I think you need to do a AJAX call on unload. But the server needs to respond before the window actualy closes. – Jaapze Jun 20 '16 at 09:56
  • **onbeforunload** is not a proper event for your objective because it execute each time when you leave your page. please follow https://eureka.ykyuen.info/2011/02/22/jquery-javascript-capture-the-browser-or-tab-closed-event/ to get your objective. – Haresh Kumar Jun 20 '16 at 09:58

0 Answers0