I need to end the session automatically when the user is inactive for some particular time say for 10 minutes. We have a method in
HttpSession session=reque
You need to set the session timeout, that is, the time after which current Session
object will be invalidated.
This can be done either by setting timeout in your web.xml like:
20
or programmatically call on the Session
object
session.setMaxInactiveInterval(valueInSeconds);
Keep an eye that session timeout period set up in web.xml is in minutes, and programmatically - in seconds.