You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return [
'service_manager' => [
'factories' => [
// Configures the default SessionManager instance
'Zend\Session\ManagerInterface' => 'Zend\Session\Service\SessionManagerFactory',
// Provides session configuration to SessionManagerFactory
'Zend\Session\Config\ConfigInterface' => 'Zend\Session\Service\SessionConfigFactory',
],
],
'session_manager' => [
// SessionManager config: validators, etc
],
'session_config' => [
// Set the session and cookie expiries to 15 minutes
'cache_expire' => 900,
'cookie_lifetime' => 900,
],
];
In Application\Module::onBootstrap, pull an instance of the SessionManager. This will inject the properly-configured SessionManager instance as the default for all new session containers.
public function onBootstrap(MvcEvent $e)
{
$manager = $e->getApplication()->getServiceManager()->get('Zend\Session\ManagerInterface');
}
Alternatively, you could use an external module such as HtSession instead of a manual configuration.