Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

A doubt about sessionDestroyed method in HttpSessionListener

843842Jun 29 2009 — edited Jul 1 2009
Hi all,

I studied that sessionDestroyed method will be fired when a session is about to invalidate .

To understand this I created a program in which I set a session's maximum inactive time as five seconds using setMaxInactiveInterval method of HttpSession

as
HttpSession session = req.getSession();  
session.setMaxInactiveInterval(5) ;  
and I expect sessionDestroyed method will be invoked before that seconds(5 seconds) which I set using setMaxInactiveInterval method but it did not .

sessionDestroyed method invoked after a minute .

Why is it so ? .I'm using Tomcat 5.5.27 (servlet 2.4 version)

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2009
Added on Jun 29 2009
5 comments
566 views