/** * Constructs a new session manager instance. * * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack. * @param \Drupal\Core\Database\Connection $connection * The database connection. * @param \Drupal\Core\Session\MetadataBag $metadata_bag * The session metadata bag. * @param \Drupal\Core\Session\SessionConfigurationInterface $session_configuration * The session configuration interface. * @param \Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler|\SessionHandlerInterface|NULL $handler * The object to register as a PHP session handler. * @see \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::setSaveHandler() */ public function __construct(RequestStack $request_stack, Connection $connection, MetadataBag $metadata_bag, SessionConfigurationInterface $session_configuration, $handler = NULL) { $options = array(); $this->sessionConfiguration = $session_configuration; $this->requestStack = $request_stack; $this->connection = $connection; parent::__construct($options, $handler, $metadata_bag); // @todo When not using the Symfony Session object, the list of bags in the // NativeSessionStorage will remain uninitialized. This will lead to // errors in NativeSessionHandler::loadSession. Remove this after // https://www.drupal.org/node/2229145, when we will be using the Symfony // session object (which registers an attribute bag with the // manager upon instantiation). $this->bags = array(); }
/** * Constructs a new session manager instance. * * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack. * @param \Drupal\Core\Database\Connection $connection * The database connection. * @param \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag $metadata_bag * The session metadata bag. * @param \Drupal\Core\Site\Settings $settings * The settings instance. */ public function __construct(RequestStack $request_stack, Connection $connection, SymfonyMetadataBag $metadata_bag, Settings $settings) { $options = array(); $this->requestStack = $request_stack; $this->connection = $connection; // Register the default session handler. // @todo Extract session storage from session handler into a service. $save_handler = new SessionHandler($this, $this->requestStack, $this->connection); $write_check_handler = new WriteCheckSessionHandler($save_handler); $this->setSaveHandler($write_check_handler); parent::__construct($options, $write_check_handler, $metadata_bag); $this->setMixedMode($settings->get('mixed_mode_sessions', FALSE)); // @todo When not using the Symfony Session object, the list of bags in the // NativeSessionStorage will remain uninitialized. This will lead to // errors in NativeSessionHandler::loadSession. Remove this after // https://drupal.org/node/2229145, when we will be using the Symfony // session object (which registers an attribute bag with the // manager upon instantiation). $this->bags = array(); }
public function __construct(string $domain) { $this->domain = $domain; parent::__construct(); }