* @note The SessionProvider must not attempt to auto-create users.
* MediaWiki will do this later (when it's safe) if the chosen session has
* a user with a valid name but no ID.
* @note The SessionProvider must not attempt to auto-create users.
* MediaWiki will do this later (when it's safe) if the chosen session has
* a user with a valid name but no ID.
* implementation assumes that it only makes sense if a session ID can be
* persisted and changing users is allowed.
*
* implementation assumes that it only makes sense if a session ID can be
* persisted and changing users is allowed.
*
* @param string|null $id ID to force for the new session
* @return SessionInfo|null
* If non-null, must return true for $info->isIdSafe(); pass true for
* @param string|null $id ID to force for the new session
* @return SessionInfo|null
* If non-null, must return true for $info->isIdSafe(); pass true for
*/
public function newSessionInfo( $id = null ) {
if ( $this->canChangeUser() && $this->persistsSessionId() ) {
*/
public function newSessionInfo( $id = null ) {
if ( $this->canChangeUser() && $this->persistsSessionId() ) {
* The default implementation checks that anything in both arrays is
* identical, then returns $providedMetadata.
*
* The default implementation checks that anything in both arrays is
* identical, then returns $providedMetadata.
*
* @param array $savedMetadata Saved provider metadata
* @param array $providedMetadata Provided provider metadata
* @return array Resulting metadata
* @param array $savedMetadata Saved provider metadata
* @param array $providedMetadata Provided provider metadata
* @return array Resulting metadata
*/
public function mergeMetadata( array $savedMetadata, array $providedMetadata ) {
foreach ( $providedMetadata as $k => $v ) {
if ( array_key_exists( $k, $savedMetadata ) && $savedMetadata[$k] !== $v ) {
*/
public function mergeMetadata( array $savedMetadata, array $providedMetadata ) {
foreach ( $providedMetadata as $k => $v ) {
if ( array_key_exists( $k, $savedMetadata ) && $savedMetadata[$k] !== $v ) {
* allows for updating the provider metadata. On failure, the provider is
* expected to write an appropriate message to its logger.
*
* allows for updating the provider metadata. On failure, the provider is
* expected to write an appropriate message to its logger.
*
* @param SessionInfo $info
* @param WebRequest $request
* @param array|null &$metadata Provider metadata, may be altered.
* @param SessionInfo $info
* @param WebRequest $request
* @param array|null &$metadata Provider metadata, may be altered.
* different user. A session provider that shoves information into cookies,
* on the other hand, could easily do so.
*
* different user. A session provider that shoves information into cookies,
* on the other hand, could easily do so.
*
* @param SessionBackend $session Session to persist
* @param WebRequest $request Request into which to persist the session
*/
* @param SessionBackend $session Session to persist
* @param WebRequest $request Request into which to persist the session
*/
* @param WebRequest $request Request from which to remove any session data
*/
abstract public function unpersistSession( WebRequest $request );
* @param WebRequest $request Request from which to remove any session data
*/
abstract public function unpersistSession( WebRequest $request );
* User::idFromName( $username ) === 0); the name should still be
* prevented, if applicable.
*
* User::idFromName( $username ) === 0); the name should still be
* prevented, if applicable.
*
*
* This default implementation takes the class name, lowercases it,
* replaces backslashes with dashes, and prefixes 'sessionprovider-' to
*
* This default implementation takes the class name, lowercases it,
* replaces backslashes with dashes, and prefixes 'sessionprovider-' to
* produces 'sessionprovider-mediawiki-session-cookiesessionprovider'.
*
* @note If self::__toString() is overridden, this will likely need to be
* produces 'sessionprovider-mediawiki-session-cookiesessionprovider'.
*
* @note If self::__toString() is overridden, this will likely need to be