Create session manager object

createService(\Zend\ServiceManager\ServiceLocatorInterface $services) : \Zend\Session\SessionManager

Will consume any combination (or zero) of the following services, when present, to construct the SessionManager instance:

  • Zend\Session\Config\ConfigInterface
  • Zend\Session\Storage\StorageInterface
  • Zend\Session\SaveHandler\SaveHandlerInterface

The first two have corresponding factories inside this namespace. The last, however, does not, due to the differences in implementations, and the fact that save handlers will often be written in userland. As such if you wish to attach a save handler to the manager, you will need to write your own factory, and assign it to the service name "Zend\Session\SaveHandler\SaveHandlerInterface", (or alias that name to your own service).

You can configure limited behaviors via the "session_manager" key of the Config service. Currently, these include:

  • enable_default_container_manager: whether to inject the created instance as the default manager for Container instances. The default value for this is true; set it to false to disable.
  • validators: ...



\Zend\ServiceManager\Exception\ServiceNotCreatedException if any collaborators are not of the correct type




Default configuration for manager behavior

$defaultManagerConfig : array