tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25600] New: - sessionDestroyed method (in HttpSessionListener) is being called twice
Date Wed, 17 Dec 2003 20:03:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25600>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25600

sessionDestroyed method (in HttpSessionListener) is being called twice

           Summary: sessionDestroyed method (in HttpSessionListener) is
                    being called twice
           Product: Tomcat 5
           Version: 5.0.16
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: rpr@senergisul.com.br


I have an application running on Tomcat 4.1.27, who uses an HttpSessionListener 
to intercept session invalidations. It runs OK, according with the 2.3 servlet 
spec, which says that the sessionDestroyed method must be called AFTER the 
session is already invalidated. (I had a lot of pain to build a logic that 
could overcome this behavior). Well, today, I moved the same application to 
Tomcat 5.0.16 and - for my surprise - the sessionDestroyed is now called BEFORE 
the session is invalidated... I KNOW that this is the correct behavior 
according to 2.4 servlet spec, and I fixed my listener to work with it. 

The problem now, is that the sessionDestroyed method is being called TWICE: one 
BEFORE the session is invalidated and another AFTER the session is already 
invalidated, in THE SAME INVALIDATION PROCESS !  And more: it only happens when 
the session expires - after timeout is reached. It does NOT happen when I 
explicity invalidate the session, with "session.invalidate()". My listener is 
full of logs and that's the only reason I could figure this out....

I just want to know if this is the correct behavior for the 2.4 servlet spec, 
or if it's a bug... I can overcome this too, but I think that if there's 
something wrong, it must fixed...

Thanks,
Roberto (Ironman)

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message