Here's a little tip for when you need to discover when a users session expires and perform any cleanup for the current logged in user.

You need a listener class that implements HttpSessionListener...