I want to make user logout when user closes the browser tab/window
I have tried this code, but this is hitting even when we refresh the browser
    window.onbeforeunload = function() {
     return "Are you sure to close without logout";
     };
Is there any method to call the event only when user closes the browser tab/window other than refreshing the browser??
Thanks in Advance
