Hi,

I have a problem in catching window close event in safar. If the user close the browser window without logging out, i have to invalidate the session. The problem is that , how to catch the window close event in safari? Unload cannot be used, since unload will be fired evenif the user clicks on someother links or refreshes the page. Kindly provide me a solution.

Thanks in advance.

you can't catch it, at least not reliably.
There are many ways to close a window, some can be caught, some can not.
I actually did extensive research into that several years ago, and that was the conclusion.

Instead you should learn how to monitor session timeouts and act on them.

Thank U Jwenting for your reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.