I have a web app for which I set up a time-based session cookie expiration as described here: Tomcat session cookie is not sent for context root request
The call to getSession() creates the session when there is no incoming session cookie, and sets the new cookie on the response. For subsequent requests it does not happen, although a timeout-based cookie needs to be prolonged, so that sessions don't time out X minutes after login time.
Do I have to getCookies(), iterate cookies, find session cookie, calculate expiration time, modify cookie, and set it on the response? Or does Tomcat provide that for these kind of sessions?
If I have to do it myself, can I get access to the xml-declared cookie name (to look for in cookies array) and max-age (to calculate new expiration from now).