I need this functionality because if suppose I set the timeout as 5 min and if the user closed the browser in 2 min and again if he/she tried to login then it will be a problem. My application will allow 1 session per user. so the user cannot login for next 3min..
This is a bad approach. So as soon as the browser closed the I need to clear the session.