views:

1153

answers:

1

How might a person simulate firing the HttpSessionListener.sessionDestroyed object in a session listener?

Is just setting the Tomcat session timeout to 1 and then waiting the only way?

+3  A: 

Use HttpSession.invalidate(). Alternatively, you can call setMaxInactiveInterval() with a small number (i.e. 1). This is less reliable as there's no guarantee as to when Tomcat will destroy the session.

James Schek