SessionManagerInterface

Defines the session manager interface. Hierarchy interface \Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterfaceinterface \Drupal\Core\Session\SessionManagerInterface File core/lib/Drupal/Core/Session/SessionManagerInterface.php, line 10 Namespace Drupal\Core\Session Members Name Modifiers Type Description SessionManagerInterface::delete public function Ends a specific user's session(s). SessionManagerInterface::destroy public function Destro

SessionManager::__construct

public SessionManager::__construct(RequestStack $request_stack, Connection $connection, MetadataBag $metadata_bag, SessionConfigurationInterface $session_configuration, $handler = NULL) Constructs a new session manager instance. Parameters \Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack. \Drupal\Core\Database\Connection $connection: The database connection. \Drupal\Core\Session\MetadataBag $metadata_bag: The session metadata bag. \Drupal\Core\Session\SessionCon

SessionManagerInterface::delete

public SessionManagerInterface::delete($uid) Ends a specific user's session(s). Parameters int $uid: User ID. File core/lib/Drupal/Core/Session/SessionManagerInterface.php, line 18 Class SessionManagerInterface Defines the session manager interface. Namespace Drupal\Core\Session Code public function delete($uid);

SessionManager::isSessionObsolete

protected SessionManager::isSessionObsolete() Determines whether the session contains user data. Return value bool TRUE when the session does not contain any values and therefore can be destroyed. File core/lib/Drupal/Core/Session/SessionManager.php, line 293 Class SessionManager Manages user sessions. Namespace Drupal\Core\Session Code protected function isSessionObsolete() { $used_session_keys = array_filter($this->getSessionDataMask()); return empty($used_session_keys); }

SessionManager::save

public SessionManager::save() Force the session to be saved and closed. This method must invoke session_write_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. Throws \RuntimeException If the session is saved without being started, or if the session is already closed. Overrides NativeSessionStorage::save File core/lib/Drupa

SessionManager::start

public SessionManager::start() Starts the session. Return value bool True if started. Throws \RuntimeException If something goes wrong starting the session. Overrides NativeSessionStorage::start File core/lib/Drupal/Core/Session/SessionManager.php, line 105 Class SessionManager Manages user sessions. Namespace Drupal\Core\Session Code public function start() { if (($this->started || $this->startedLazy) && !$this->closed) { return $this->started; } $requ

SessionManager::regenerate

public SessionManager::regenerate($destroy = FALSE, $lifetime = NULL) Regenerates id that represents this storage. This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is involve

SessionManager::setWriteSafeHandler

public SessionManager::setWriteSafeHandler(WriteSafeSessionHandlerInterface $handler) Sets the write safe session handler. @todo: This should be removed once all database queries are removed from the session manager class. Overrides SessionManagerInterface::setWriteSafeHandler File core/lib/Drupal/Core/Session/SessionManager.php, line 271 Class SessionManager Manages user sessions. Namespace Drupal\Core\Session Code public function setWriteSafeHandler(WriteSafeSessionHandlerInterface $

SessionManager::startNow

protected SessionManager::startNow() Forcibly start a PHP session. Return value bool TRUE if the session is started. File core/lib/Drupal/Core/Session/SessionManager.php, line 153 Class SessionManager Manages user sessions. Namespace Drupal\Core\Session Code protected function startNow() { if ($this->isCli()) { return FALSE; } if ($this->startedLazy) { // Save current session data before starting it, as PHP will destroy it. $session_data = $_SESSION; } $r

SessionManager::$writeSafeHandler

The write safe session handler. @todo: This reference should be removed once all database queries are removed from the session manager class. Type: \Drupal\Core\Session\WriteSafeSessionHandlerInterface File core/lib/Drupal/Core/Session/SessionManager.php, line 68 Class SessionManager Manages user sessions. Namespace Drupal\Core\Session Code protected $writeSafeHandler;