Amar Bisht

Amar Bisht

  • NA
  • 159
  • 8.2k

How to identify browser is closed or Page is referesed?

Nov 19 2014 6:17 AM
Hi guys,


I want to clear all session when browser or browser tab is closed by user.But I facing an issue When I am refreshing page or closing  browser . onbeforeunload or onunload functions executing on both time(refresh & Close). Is there any solution to identify whether browser is closed or page get refreshed?
I was googled a lot of articles but not yet get proper solution.
please share the code if you have faced same issue.


any help would be appriciated
Thanks and regards
Amar

Answers (1)