T
The Barge
Im trying to find a way to detect when a session expires. The obvious way
is to use the HttpSessionListener and it's sessionDestroyed method. The
problem is - you cant access the session data because when this method is
called the session has already expired (per the servlet 2.3 specs).
Is there a way to create a listener thats called PRIOR to the session
termination? I have code that adds a session attribute when a user logs in
(i.e. a user ID). I'd like to run some java code to call a logout type
method when the session expires (if someone closes a window rather than
clicking "logout"). But I need to be able to run a session.getAttribute to
pull the user ID information.
Is there a way to implement this using web.xml? I've done some research
and apparently you can use a HttpSessionBindingListener.. but the problem
with this is that it has to be added to every session. I'd like to find a
solution like the HttpSessionListener that uses an entry in the web.xml
file.
Is there any way to do this similar to the HttpSessionListener thats called
prior to the session termination so I can still read the session
attributes? BTW - My app is using the latest version of Jetty.
Thanks,
The Barge
is to use the HttpSessionListener and it's sessionDestroyed method. The
problem is - you cant access the session data because when this method is
called the session has already expired (per the servlet 2.3 specs).
Is there a way to create a listener thats called PRIOR to the session
termination? I have code that adds a session attribute when a user logs in
(i.e. a user ID). I'd like to run some java code to call a logout type
method when the session expires (if someone closes a window rather than
clicking "logout"). But I need to be able to run a session.getAttribute to
pull the user ID information.
Is there a way to implement this using web.xml? I've done some research
and apparently you can use a HttpSessionBindingListener.. but the problem
with this is that it has to be added to every session. I'd like to find a
solution like the HttpSessionListener that uses an entry in the web.xml
file.
Is there any way to do this similar to the HttpSessionListener thats called
prior to the session termination so I can still read the session
attributes? BTW - My app is using the latest version of Jetty.
Thanks,
The Barge