aspose file tools*
The moose likes Servlets and the fly likes determining distinction between sessin expiring from timeout and invalidate method ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "determining distinction between sessin expiring from timeout and invalidate method ?" Watch "determining distinction between sessin expiring from timeout and invalidate method ?" New topic
Author

determining distinction between sessin expiring from timeout and invalidate method ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

below is what the servlet 3.0 specs say about session events. as the following paragraph says that we CAN determine the distinction between session invalidation because of container timeout and application calling invalidate method. i thought about it as to how it can be achieved but i'm not able to get it. please help how can we make this distinction as the specs says below

Session Events
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 timed out the session, or because a Web component
within the application called the invalidate method. The distinction may be
determined indirectly using listeners and the HttpSession API methods.


Regards


OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
Anshuman Chakraborty
Greenhorn

Joined: Oct 05, 2010
Posts: 20
It can be determined using the difference of current time and last accessed time to compare with maximum inactive interval allowed.

If the difference is more than or equal to inactive interval, The session was expired by the container else it was invalidated.


Anshuman Chakraborty
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: determining distinction between sessin expiring from timeout and invalidate method ?
 
Similar Threads
Session Events
Session timeout problem
Tomcat stops invalidating sessions after session expiry.
session timeout in DD
session that never dies