aspose file tools*
The moose likes Servlets and the fly likes How to use setMaxInactiveInterval() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to use setMaxInactiveInterval()" Watch "How to use setMaxInactiveInterval()" New topic
Author

How to use setMaxInactiveInterval()

Sundaralingam Subramaniyan
Greenhorn

Joined: Sep 07, 2007
Posts: 11
can any one explain me about setMaxInactiveInterval() method.
i have used this method as

HttpSession session = req.getSession(true);
session.setMaxInactiveInterval(5);

but the problem is after 5 seconds, the session is still active.
i need assistance
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Sundar_S,
Please check your private messages.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
By using setMaxInactiveInterval you are ensuring that the session is no longer valid after the specified time of inactivity. What you have done look ok.

What are you doing to test this out? Post all your code and explain.
Gobinath Manoj
Greenhorn

Joined: Oct 17, 2007
Posts: 11
Please give me the code fully, Bcoz your session inactive method id correct i think you have problem with your code


Thanks Regards <br />Gobinath.L
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Gobinath Manoj, please use real words when posting to the forums. Abbreviations such as "bcoz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to use setMaxInactiveInterval()