I had a problem with symfony2 session component. I set some data to session through session container like this:
$sess = $this->get( 'session' );
$sess->set( 'some_key', 'some_value' );
But after a little bit of time (about 15-20 minutes) the session got lost.
Can I set session life time parameter? The perfect variant for me would be if I can set certain time of session live period…Can anybody please help?
You can set the session expiration time in your config file under the
frameworksection. Mine looks like this:config.ymlYou can change the
framework.session.lifetimevalue to anything you’d like, in seconds (it defaults to 3600, or 1 hour).Reference here.