I\'m building an Ajax app in Symfony2 where a user logs in, and then from that point forward everything is handled by POST requests. After defining the session lifetime to 5
The lifetime of a session is it's maximum age. This is controlled via a cookie which has already been created and is not refreshed any longer from the server side (because the session is already established). You can just update this cookie manually and I think this will make it with symfony2.
The probably easiest is to regenerate the session id w/o destroying the session:
$this->get('session')->migrate();
This should trigger an update on the session cookie.
Probably related questions: