I am trying to perform certain operations when a HttpSession has been destroyed. However, if I close my browser the sessionDestroyed() method of my HttpSessionListener is never invoked. My time out as set in web.xml is only 5000ms. My listener is configured correctly, as I do get the sessionCreated() method call. I am using jboss3.2.3 with tomcat.
Never be satisfied with anything less than the best and you will surely pass the test...
Closing the browser has nothing to do with it. The servlet engine should do the timeout when the required number of seconds (not milliseconds) have passed without the session being accessed. You can check to see if the timeout is being set correctly with the HttpSession method getMaxInactiveInterval() - which returns seconds. The session-timeout parameter in web.xml is in minutes, the setMaxInactiveInterval() method in HttpSession is in seconds. Bill [ April 15, 2004: Message edited by: William Brogden ]
Joined: Jan 15, 2002
Yes. I had the time setout set in Millis as 2400 which translated to minutes. Thanks.