Manages user sessions.
This class implements the custom session management code inherited from Drupal 7 on top of the corresponding Symfony component. Regrettably the name NativeSessionStorage is not quite accurate. In fact the responsibility for storing and retrieving session data has been extracted from it in Symfony 2.1 but the class name was not changed.
@todo In fact the NativeSessionStorage class already implements all of the functionality required by a typical Symfony application. Normally it is not necessary to subclass it at all. In order to reach the point where Drupal can use the Symfony session management unmodified, the code implemented here needs to be extracted either into a dedicated session handler proxy (e.g. sid-hashing) or relocated to the authentication subsystem.
Hierarchy
- class \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage implements \Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface
- class \Drupal\Core\Session\SessionManager implements SessionManagerInterface uses DependencySerializationTrait
File
- core/lib/Drupal/Core/Session/SessionManager.php, line 28
Namespace
Drupal\Core\Session
Members
Name | Modifiers | Type | Description |
---|---|---|---|
DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. |
DependencySerializationTrait::__sleep | public | function | |
DependencySerializationTrait::__wakeup | public | function | |
NativeSessionStorage::$bags | protected | property | Array of SessionBagInterface. |
NativeSessionStorage::$closed | protected | property | |
NativeSessionStorage::$metadataBag | protected | property | |
NativeSessionStorage::$saveHandler | protected | property | |
NativeSessionStorage::$started | protected | property | |
NativeSessionStorage::clear | public | function | Clear all session data in memory. Overrides SessionStorageInterface::clear |
NativeSessionStorage::getBag | public | function | Gets a SessionBagInterface by name. Overrides SessionStorageInterface::getBag |
NativeSessionStorage::getId | public | function | Returns the session ID. Overrides SessionStorageInterface::getId |
NativeSessionStorage::getMetadataBag | public | function | Gets the MetadataBag. Overrides SessionStorageInterface::getMetadataBag |
NativeSessionStorage::getName | public | function | Returns the session name. Overrides SessionStorageInterface::getName |
NativeSessionStorage::getSaveHandler | public | function | Gets the save handler instance. |
NativeSessionStorage::isStarted | public | function | Checks if the session is started. Overrides SessionStorageInterface::isStarted |
NativeSessionStorage::loadSession | protected | function | Load the session with attributes. |
NativeSessionStorage::registerBag | public | function | Registers a SessionBagInterface for use. Overrides SessionStorageInterface::registerBag |
NativeSessionStorage::setId | public | function | Sets the session ID. Overrides SessionStorageInterface::setId |
NativeSessionStorage::setMetadataBag | public | function | Sets the MetadataBag. |
NativeSessionStorage::setName | public | function | Sets the session name. Overrides SessionStorageInterface::setName |
NativeSessionStorage::setOptions | public | function | Sets session.* ini variables. |
NativeSessionStorage::setSaveHandler | public | function | Registers session save handler as a PHP session handler. |
SessionManager::$connection | protected | property | The database connection to use. |
SessionManager::$requestStack | protected | property | The request stack. |
SessionManager::$sessionConfiguration | protected | property | The session configuration. |
SessionManager::$startedLazy | protected | property | Whether a lazy session has been started. |
SessionManager::$writeSafeHandler | protected | property | The write safe session handler. |
SessionManager::delete | public | function | Ends a specific user's session(s). Overrides SessionManagerInterface::delete |
SessionManager::destroy | public | function | Destroys the current session and removes session cookies. Overrides SessionManagerInterface::destroy |
SessionManager::getSessionDataMask | protected | function | Returns a map specifying which session key is containing user data. |
SessionManager::isCli | protected | function | Returns whether the current PHP process runs on CLI. |
SessionManager::isSessionObsolete | protected | function | Determines whether the session contains user data. |
SessionManager::migrateStoredSession | protected | function | Migrates the current session to a new session id. |
SessionManager::regenerate | public | function | Regenerates id that represents this storage. Overrides NativeSessionStorage::regenerate |
SessionManager::save | public | function | Force the session to be saved and closed. Overrides NativeSessionStorage::save |
SessionManager::setWriteSafeHandler | public | function | Sets the write safe session handler. Overrides SessionManagerInterface::setWriteSafeHandler |
SessionManager::start | public | function | Starts the session. Overrides NativeSessionStorage::start |
SessionManager::startNow | protected | function | Forcibly start a PHP session. |
SessionManager::__construct | public | function | Constructs a new session manager instance. Overrides NativeSessionStorage::__construct |
Please login to continue.