How to check HttpSessionListener.sessionDestroyed in Java webapp?

How can a human simulate the launch of the HttpSessionListener.sessionDestroyed object in the listening session?

Just setting the Tomcat session timeout to 1 and then waiting for the only way?

+1


source to share


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







All Articles