u can try to implement HttpSessionBindingListener in a class and 'put'
into the session an instance of this class (for example with the
attribute neme XXX)
then in

public void valueUnbound(HttpSessionBindingEvent event)

u can do the clean-up since this function will be called just before the
session is destroyed(OR if u overwrite XXX, what you don't wanna do in
this case:))

THIS WILL WORK ONLY IF THE CLIENT HAS COOKIES ENABLED....


Andrew Ormsby wrote:
>
> Hi,
>
> I have a web application (Tomcat 4, Servlet 2.3 API) which does some
> tracking of per-session information.  What I'd like to do is catch
> session termination by using sessionDestroyed() in an
> HttpSessionListener in order to do some cleanup, store some session
> reporting information to a database, and so on.
>
> Unfortunately, I can't do that because sessionDestroyed() is called
> *after* the session is invalidated - this means that while I can get the
> sessionId, I can't get any of the other session attributes like creation
> time or last access time.
>
> This is an unfortunate inconsistency with contextDestroyed() in
> ServletContextListener which is called when the context is about to shut
> down. This seems a much more useful pattern.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to