I have created a logon page where user enters username and password and logs on to website.
1) What I need is if user clicks browser's corss button after logging an alert should appear conforming from user that if he wants to close window. If user clicks yes then user should be logged off.
2) Similar behaviour is needed when user logs on and then click browser's back button .
Waiting for your response.
window.onbeforeunload = your.fn
window.onunload = your.fn