Thought I will add one more way to invalidate session.
We can set MaxInactiveInterval in HttpSession object using the method setMaxInactiveInterval.
Having said that, I am wondering what is the best way to do this?
Please share if anyone knows what's the difference? Following are some assumptions I made. Correct me if I am wrong. 1. HttpSession.setMaxInactiveInterval overrides the entry in web.xml 2. web.xml is configurable???
Joined: Nov 15, 2004
Following are some assumptions I made. Correct me if I am wrong. 1. HttpSession.setMaxInactiveInterval overrides the entry in web.xml
Yes you are correct.
2. web.xml is configurable???
You can configure session time in web.xml with
The difference is you specify session duration in minutes in web.xml whereas in setMaxInactiveInterval() you specify session duration in seconds