Is there a way to reset the timeout counter of a HTTPSession other than through serving a HTTP request?
I’m looking for something like
session.resetTimeout();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So, you’ve a
HttpSessionat hands without having a concreteHttpServletRequest?You could increment the max inactive interval with the sum of the current inactive time and the max inactive interval.
However, this requires some filter which resets it back to the default max inactive interval again on every request when its value is off from the default.
On Servlet 3.0, this value is obtainable by
SessionCookieConfig#getMaxAge().