How to check HttpSessionListener.sessionDestroyed in Java webapp?
1 answer
Use HttpSession.invalidate()
. Alternatively, you can call setMaxInactiveInterval()
with a small number (i.e. 1). This is less reliable as there is no guarantee that Tomcat will destroy the session.
+5
source to share