I am using a an HttpSessionListener to detect the start and end of HTTP Sessions.
The issue I have is that I can only detect the end of the session when I programmatically invoke the invalidate() method,the session timesout or I shutdown the server.This will trigger the sessionDestroyed() method of the listener.
However I also need the listener to be fired when the user closes their browser without invoking the servlet that invalidates the session.(I'm sure we've all killed a browser before without properly logging out).This needs to be fired immediately as it is for a connection counter, therefore setting session timeout values wouldn't suffice.
Stateless Http really gets up my nose sometimes!! Any suggestions are most welcome.
-
Detecting the end of an HttpSession (5 messages)
- Posted by: Damien Dallimore
- Posted on: October 02 2002 00:18 EDT
Threaded Messages (5)
- Detecting the end of an HttpSession by Dmitry Namiot on October 02 2002 11:15 EDT
- Detecting the end of an HttpSession by Milind Deshpande on October 02 2002 13:59 EDT
- Detecting the end of an HttpSession by Leonard Gurevich on October 07 2002 13:21 EDT
- Detecting the end of an HttpSession by Leonard Gurevich on October 07 2002 13:22 EDT
- Detecting the end of an HttpSession by Leonard Gurevich on October 07 2002 13:22 EDT
-
Detecting the end of an HttpSession[ Go to top ]
- Posted by: Dmitry Namiot
- Posted on: October 02 2002 11:15 EDT
- in response to Damien Dallimore
You can define onUnload event with some JavaScript code,
where you will be able to call some URL ...
Dmitry
Coldbeans -
Detecting the end of an HttpSession[ Go to top ]
- Posted by: Milind Deshpande
- Posted on: October 02 2002 13:59 EDT
- in response to Dmitry Namiot
Unfortunately, unload is not going to work because the user is going to loose his session every time he clicks on any link which gets a new page (because of unload event of the old page). At the most the user will see the page that is displayed right after login. Any clicks on this page will trigger a call to session invalidate function, and, if the application is done right, he will/should again see the login page because access to the next page will blocked beacuse of invalid session. -
Detecting the end of an HttpSession[ Go to top ]
- Posted by: Leonard Gurevich
- Posted on: October 07 2002 13:21 EDT
- in response to Damien Dallimore
Use SessionListener: see Servlet 2.3 specs. -
Detecting the end of an HttpSession[ Go to top ]
- Posted by: Leonard Gurevich
- Posted on: October 07 2002 13:22 EDT
- in response to Damien Dallimore
Use SessionListener: see Servlet 2.3 specs. -
Detecting the end of an HttpSession[ Go to top ]
- Posted by: Leonard Gurevich
- Posted on: October 07 2002 13:22 EDT
- in response to Damien Dallimore
Use SessionListener: see Servlet 2.3 specs.