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!

httpsession.setMaxInactiveInterval() doesn't time out correctly.

809646Nov 1 2010 — edited Nov 1 2010
Hi,

I tried to set the MaxInactiveInterval dynamically. That is on every request to the server the setMaxInactiveInterval() should be reset. So the session invalidation happens after inactive time interval of specified duration(600 secs as per my code) from the last request received by the server.

But when I actually tested the below code, I found the inactive interval exceeds 600 seconds from the last request received by server.
I tested in both Websphere server and tomcat server. the timeout/invalidation was very inconsistent in both the servers.

HttpSession httpSession = request.getSession(false);
if(httpSession!=null){
httpSession.setMaxInactiveInterval(600);
}

My requirement is from the last request received by the server for a particular session, the session should get invalidated by the specified time interval(600 secs as per my code) as mentioned in httpSession.setMaxInactiveInterval(600).

Please help me out to solve this?

With Regards,
Arvind.I
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2010
Added on Nov 1 2010
1 comment
601 views