Reputation: 51159
I am catching user logouts with hook with
logout.events.post=...
action and this works.
But also I want to catch browser close as logout too.
How can I accomplish this?
servlet.session.destroy.events=
is not fired I guess.
Thanks.
Upvotes: 1
Views: 1469
Reputation: 9404
The browser close happens on the client... and the session may not have been destroyed (user may not have logged out).
On the client side, you may want to do
window.onbeforeunload = function() {
make_an_ajax_call_to_server_to_notify();
return null;//to close
//OR
//return "Do you really want to close?" to let user click an "Ok" button
}
Upvotes: 3