The session will timeout based on the session timeout element in web.xml or the setMaxInactiveInterval() method can be used to control this time. You can adjust this based on the solution need - declarative or programmatic
yes, you can give like session.setMaxInactiveInterval(86400000);
and also you can configure in web.xml. like below
In web.xml we can specify in minutes only In setMaxInactiveInterval we can specify milliseconds only [ May 19, 2008: Message edited by: Karthikeyan R ]
Joined: Oct 04, 2007
Thanks.whether i have to mention the set max interval in each servlet wherever i have maintained the session or only in login servlet?
Joined: Apr 30, 2008
if you set session-timeout in web.xml it effects whole web application, if you set in setMaxInactiveInterval it effect only that particular servlet, so using session-timeout tag in web.xml is good coding practice.