You can define a class which implements HttpSessionBindingListener and override the valueUnbound()
method.