On accessing session data on the server side, its modified_time
gets set, therefore extending its expiration time into the future.
However, this does not happen for PHPSESSID
cookie. While session data expiration on the server side is extended, the cookie expiration is not. If the cookie expires, the user will lose his session - he will have no session ID to give when sending a request.
Is there any way to tell Symfony\Component\HttpFoundation\Session\Session
to extend the cookie expiration date?
- Can this be done for the same session ID? Or will we have to regenerate it (seems inefficient to do for many users X many requests)?
- Should I set it myself manually (disregarding the OOP principles)
I've found $request->getSession()->getMetadataBag()
and tried setting stampNew()
, but this does not seem to interact with the PHPSESSID
cookie.