|
MediaWiki master
|
This is a session store abstraction layer, which can be used to read and write sessions to configured backend(s). More...
Inherits LoggerAwareInterface.
Inherited by MediaWiki\Session\MultiBackendSessionStore, and MediaWiki\Session\SingleBackendSessionStore.

Public Member Functions | |
| delete (SessionInfo $sessionInfo) | |
| Delete the session data for a given ID from the session store. | |
| get (SessionInfo $sessionInfo) | |
| Retrieves the session data for a given session ID. | |
| set (SessionInfo $sessionInfo, $value, $exptime=0, $flags=0) | |
| Write the session data for a given key to the session store. | |
| shutdown () | |
| Will be called during shutdown. | |
This is a session store abstraction layer, which can be used to read and write sessions to configured backend(s).
Backends can be single or multiple, depending on the configuration of the site.
Sessions are read or written to the store(s), depending on the session type. The get(), set() and delete() methods are in charge of deciding the relevant store to fetch, write, or delete content from. Sessions can be strongly persistent or weakly persistent based on their type.
The SessionManager should be configured with a very fast storage system that is optimized for holding key-value pairs. It expects:
The SessionManager uses set() and delete() for write operations, which should be synchronous in the local data centre, and replicate asynchronously to any others.
Anonymous sessions (used mainly for login/signup) can share the same storage as logged-in sessions, or can use a separate store. On high-traffic wikis, separating the two can help reduce storage needs, and isolate logged-in users from problems caused by spikes of anonymous sessions (which can be generated by web crawlers and are easier to DoS).
The loss of anonymous sessions is less disruptive than the loss of authenticated sessions (will typically only affect users who are right in the middle of login or signup) and so a store with less redundancy or persistence can be used.
Definition at line 53 of file SessionStore.php.
| MediaWiki\Session\SessionStore::delete | ( | SessionInfo | $sessionInfo | ) |
Delete the session data for a given ID from the session store.
| SessionInfo | $sessionInfo |
Implemented in MediaWiki\Session\MultiBackendSessionStore, and MediaWiki\Session\SingleBackendSessionStore.
| MediaWiki\Session\SessionStore::get | ( | SessionInfo | $sessionInfo | ) |
Retrieves the session data for a given session ID.
Should return false if the session is not found.
| SessionInfo | $sessionInfo |
Implemented in MediaWiki\Session\MultiBackendSessionStore, and MediaWiki\Session\SingleBackendSessionStore.
Referenced by MediaWiki\Session\SessionBackend\__construct().
| MediaWiki\Session\SessionStore::set | ( | SessionInfo | $sessionInfo, |
| $value, | |||
| $exptime = 0, | |||
| $flags = 0 ) |
Write the session data for a given key to the session store.
| SessionInfo | $sessionInfo | |
| mixed | $value | |
| int | $exptime | |
| int | $flags | Should be one of BagOStuff::WRITE_* constants |
Implemented in MediaWiki\Session\MultiBackendSessionStore, and MediaWiki\Session\SingleBackendSessionStore.
| MediaWiki\Session\SessionStore::shutdown | ( | ) |
Will be called during shutdown.
Implemented in MediaWiki\Session\MultiBackendSessionStore, and MediaWiki\Session\SingleBackendSessionStore.