The following is from the servlet 2.3 specification. Could someone please inform me just how one can tell whether a session was invalided because the session timed out or the application called invalidate? "Listener classes provide the developer with a way of tracking sessions within a web application. It is often useful in tracking sessions to know whether a session became invalid because the container time out the session, or because a web component within the application called the invalidate method. The distinction may be determined using listeners and the HTTPSession API methods".
Sun Certified J2EE Architect for the J2EE Platform (Part 1)<br />Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
Peter den Haan
posted 14 years ago
The HttpSessionEvent gives you the HttpSession that is being destroyed. You can then compare (System.currentTimeMillis() - session.getLastAccessTime())/1000 with session.getMaxInactiveInterval() and determine whether the session has expired. If not, it must have been invalidated. - Peter [ May 02, 2002: Message edited by: Peter den Haan ]
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads