I am trying to invalidate the session when the user closes the browser without logging out. I tried using generated event unLoad
, but this event also fired when the user refreshes the page or presses the back button. So i want to invalidate the session when the browser closes.
If the user logs out normally I am invalidating the session using the code session.invalidate();
, but if the user closes the browser the session is not invalidated until container specific time out. How can I achieve this?