Determine Whether a User Session Has Expired or Been Removed

Define a class, say SessionTimeoutIndicator, which implements theinterface javax.servlet.http.HttpSessionBindingListener. Next create a SessionTimeoutIndicator object and add it to the user session. When the session is removed, the SessionTimeoutIndicator.valueUnbound() method will be called by the Servlet engine. You can then implement valueUnbound() to do the required operation.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: