devxlogo

Determine Whether a User Session Has Expired or Been Removed

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.

devx-admin

Share the Post: