File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes session.setMaxInactiveInterval(int) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "session.setMaxInactiveInterval(int)" Watch "session.setMaxInactiveInterval(int)" New topic


Milesh Bhana

Joined: Feb 18, 2010
Posts: 5
I've noticed a discrepancy with this.


HFSJ and Enthuware mock exams say using a value of 0 will immedately invalidate a session.

JEE6 API Javadoc:
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.
An interval value of zero or less indicates that the session should never timeout.

I tried on tomcat and session stayed alive.

What gives?

OCJP6 88%, OCWCD6 92%
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper

Joined: Apr 07, 2010
Posts: 2099

Hi Milesh,

Have a look here

I agree. Here's the link:
subject: session.setMaxInactiveInterval(int)
It's not a secret anymore!