MediaWiki  1.33.0
InstallerSessionProvider Class Reference
Inheritance diagram for InstallerSessionProvider:
Collaboration diagram for InstallerSessionProvider:

Public Member Functions

 canChangeUser ()
 Sure, you can be whoever you want, as long as you have ID 0. More...
 
 persistSession (SessionBackend $session, WebRequest $request)
 Persist a session into a request/response. More...
 
 persistsSessionId ()
 Yes we will treat your data with great care! More...
 
 provideSessionInfo (WebRequest $request)
 Pretend there is a session, to avoid MWCryptRand overhead. More...
 
 unpersistSession (WebRequest $request)
 Remove any persisted session from a request/response. More...
 
- Public Member Functions inherited from MediaWiki\Session\SessionProvider
 __construct ()
 
 __toString ()
 
 describe (Language $lang)
 Return an identifier for this session type. More...
 
 getAllowedUserRights (SessionBackend $backend)
 Fetch the rights allowed the user when the specified session is active. More...
 
 getManager ()
 Get the session manager. More...
 
 getRememberUserDuration ()
 Returns the duration (in seconds) for which users will be remembered when Session::setRememberUser() is set. More...
 
 getVaryCookies ()
 Return the list of cookies that need varying on. More...
 
 getVaryHeaders ()
 Return the HTTP headers that need varying on. More...
 
 invalidateSessionsForUser (User $user)
 Invalidate existing sessions for a user. More...
 
 mergeMetadata (array $savedMetadata, array $providedMetadata)
 Merge saved session provider metadata. More...
 
 newSessionInfo ( $id=null)
 Provide session info for a new, empty session. More...
 
 preventSessionsForUser ( $username)
 Prevent future sessions for the user. More...
 
 refreshSessionInfo (SessionInfo $info, WebRequest $request, &$metadata)
 Validate a loaded SessionInfo and refresh provider metadata. More...
 
 sessionIdWasReset (SessionBackend $session, $oldId)
 Notification that the session ID was reset. More...
 
 setConfig (Config $config)
 Set configuration. More...
 
 setLogger (LoggerInterface $logger)
 
 setManager (SessionManager $manager)
 Set the session manager. More...
 
 suggestLoginUsername (WebRequest $request)
 Get a suggested username for the login form. More...
 
 whyNoSession ()
 Return a Message for why sessions might not be being persisted. More...
 

Additional Inherited Members

- Protected Member Functions inherited from MediaWiki\Session\SessionProvider
 describeMessage ()
 Return a Message identifying this session type. More...
 
 hashToSessionId ( $data, $key=null)
 Hash data as a session ID. More...
 
- Protected Attributes inherited from MediaWiki\Session\SessionProvider
Config $config
 
LoggerInterface $logger
 
SessionManager $manager
 
int $priority
 Session priority. More...
 

Detailed Description

Definition at line 30 of file InstallerSessionProvider.php.

Member Function Documentation

◆ canChangeUser()

InstallerSessionProvider::canChangeUser ( )

Sure, you can be whoever you want, as long as you have ID 0.

Returns
bool

Reimplemented from MediaWiki\Session\SessionProvider.

Definition at line 55 of file InstallerSessionProvider.php.

◆ persistSession()

InstallerSessionProvider::persistSession ( SessionBackend  $session,
WebRequest  $request 
)

Persist a session into a request/response.

For example, you might set cookies for the session's ID, user ID, user name, and user token on the passed request.

To correctly persist a user independently of the session ID, the provider should persist both the user ID (or name, but preferably the ID) and the user token. When reading the data from the request, it should construct a User object from the ID/name and then verify that the User object's token matches the token included in the request. Should the tokens not match, an anonymous user must be passed to SessionInfo::__construct().

When persisting a user independently of the session ID, $session->shouldRememberUser() should be checked first. If this returns false, the user token must not be saved to cookies. The user name and/or ID may be persisted, and should be used to construct an unverified UserInfo to pass to SessionInfo::__construct().

A backend that cannot persist sesison ID or user info should implement this as a no-op.

Access:\n protected For use by \MediaWiki\Session\SessionBackend only
Parameters
SessionBackend$sessionSession to persist
WebRequest$requestRequest into which to persist the session

Reimplemented from MediaWiki\Session\SessionProvider.

Definition at line 59 of file InstallerSessionProvider.php.

◆ persistsSessionId()

InstallerSessionProvider::persistsSessionId ( )

Yes we will treat your data with great care!

Returns
bool

Reimplemented from MediaWiki\Session\SessionProvider.

Definition at line 47 of file InstallerSessionProvider.php.

◆ provideSessionInfo()

InstallerSessionProvider::provideSessionInfo ( WebRequest  $request)

Pretend there is a session, to avoid MWCryptRand overhead.

Parameters
WebRequest$request
Returns
SessionInfo

Reimplemented from MediaWiki\Session\SessionProvider.

Definition at line 36 of file InstallerSessionProvider.php.

◆ unpersistSession()

InstallerSessionProvider::unpersistSession ( WebRequest  $request)

Remove any persisted session from a request/response.

For example, blank and expire any cookies set by self::persistSession().

A backend that cannot persist sesison ID or user info should implement this as a no-op.

Access:\n protected For use by \MediaWiki\Session\SessionManager only
Parameters
WebRequest$requestRequest from which to remove any session data

Reimplemented from MediaWiki\Session\SessionProvider.

Definition at line 62 of file InstallerSessionProvider.php.


The documentation for this class was generated from the following file: