We have site with forms based authentication. When user logs in and closes browser (whole browser) he is logged out. But when he closes tab in which he opened site, he is still logged in when he reopens tab and opens site again.

How we can logout user/kill session when tab in browser is closed?

2 Answers 2


That's a browser issue. The whole browser is required to be closed because the session information is still in the browser. The answer here is that it is a training issue to make sure users log out properly.


Maybe you can build in some mechanism where it will check if user is still active or not, if for some periode of time the users wasn't active on the website he could be automatically logged out. If this approach is possible you could try it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.