|
[SOLVED] logout user when session expires
Hi All,
I have developed a web application. In which i want to add logout functionality. For this i used HttpSessionListener, but not working as i wanted.
I marked user logout in sessionDestroyed() method(by updating Database).
If session is timeout then container calls the sessionDestroyed() method and i update the Database but when i explicitly call session.invalidate() (when user click on logout link)values are unbind from session object but container does not call sessionDestroyed() method so not able to update database.
and also need to logout user when user closes browser window.
Please give your valuable idea on the same.
sanjeev
|