MediaWiki
1.28.0
|
An ImmutableSessionProviderWithCookie doesn't persist the user, but optionally can use a cookie to support multiple IDs per session. More...
Public Member Functions | |
__construct ($params=[]) | |
canChangeUser () | |
getVaryCookies () | |
persistSession (SessionBackend $session, WebRequest $request) | |
persistsSessionId () | |
unpersistSession (WebRequest $request) | |
whyNoSession () | |
Return a Message for why sessions might not be being persisted. More... | |
Public Member Functions inherited from MediaWiki\Session\SessionProvider | |
__construct () | |
__toString () | |
canChangeUser () | |
Indicate whether the user associated with the request can be changed. More... | |
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... | |
persistSession (SessionBackend $session, WebRequest $request) | |
Persist a session into a request/response. More... | |
persistsSessionId () | |
Indicate whether self::persistSession() can save arbitrary session IDs. More... | |
preventSessionsForUser ($username) | |
Prevent future sessions for the user. More... | |
provideSessionInfo (WebRequest $request) | |
Provide session info for a request. 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... | |
unpersistSession (WebRequest $request) | |
Remove any persisted session from a request/response. More... | |
whyNoSession () | |
Return a Message for why sessions might not be being persisted. More... | |
Protected Member Functions | |
getSessionIdFromCookie (WebRequest $request) | |
Get the session ID from the cookie, if any. More... | |
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 | |
string null | $sessionCookieName = null |
$sessionCookieOptions = [] | |
Protected Attributes inherited from MediaWiki\Session\SessionProvider | |
Config | $config |
LoggerInterface | $logger |
SessionManager | $manager |
int | $priority |
Session priority. More... | |
An ImmutableSessionProviderWithCookie doesn't persist the user, but optionally can use a cookie to support multiple IDs per session.
As mentioned in the documentation for SessionProvider, many methods that are technically "cannot persist ID" could be turned into "can persist ID but not changing User" using a session cookie. This class implements such an optional session cookie.
Definition at line 40 of file ImmutableSessionProviderWithCookie.php.
MediaWiki\Session\ImmutableSessionProviderWithCookie::__construct | ( | $params = [] | ) |
array | $params | Keys include:
|
Definition at line 52 of file ImmutableSessionProviderWithCookie.php.
References $params.
MediaWiki\Session\ImmutableSessionProviderWithCookie::canChangeUser | ( | ) |
Definition at line 98 of file ImmutableSessionProviderWithCookie.php.
|
protected |
Get the session ID from the cookie, if any.
Only call this if $this->sessionCookieName !== null. If sessionCookieName is null, do some logic (probably involving a call to $this->hashToSessionId()) to create the single session ID corresponding to this WebRequest instead of calling this method.
WebRequest | $request |
Definition at line 80 of file ImmutableSessionProviderWithCookie.php.
References WebRequest\getCookie(), and MediaWiki\Session\SessionManager\validateSessionId().
Referenced by MediaWiki\Session\Session\BotPasswordSessionProvider\newSessionForRequest(), and MediaWiki\Session\Session\BotPasswordSessionProvider\provideSessionInfo().
MediaWiki\Session\ImmutableSessionProviderWithCookie::getVaryCookies | ( | ) |
Definition at line 139 of file ImmutableSessionProviderWithCookie.php.
References MediaWiki\Session\ImmutableSessionProviderWithCookie\$sessionCookieName.
MediaWiki\Session\ImmutableSessionProviderWithCookie::persistSession | ( | SessionBackend | $session, |
WebRequest | $request | ||
) |
Definition at line 102 of file ImmutableSessionProviderWithCookie.php.
References $options, $response, MediaWiki\Session\ImmutableSessionProviderWithCookie\$sessionCookieOptions, MediaWiki\Session\SessionBackend\getId(), MediaWiki\Session\SessionBackend\getUser(), WebRequest\response(), and MediaWiki\Session\SessionBackend\shouldForceHTTPS().
MediaWiki\Session\ImmutableSessionProviderWithCookie::persistsSessionId | ( | ) |
Definition at line 94 of file ImmutableSessionProviderWithCookie.php.
MediaWiki\Session\ImmutableSessionProviderWithCookie::unpersistSession | ( | WebRequest | $request | ) |
Definition at line 124 of file ImmutableSessionProviderWithCookie.php.
References $response, and WebRequest\response().
MediaWiki\Session\ImmutableSessionProviderWithCookie::whyNoSession | ( | ) |
Return a Message for why sessions might not be being persisted.
For example, "check whether you're blocking our cookies".
Implements MediaWiki\Session\SessionProviderInterface.
Definition at line 150 of file ImmutableSessionProviderWithCookie.php.
References wfMessage().
|
protected |
Definition at line 43 of file ImmutableSessionProviderWithCookie.php.
Referenced by MediaWiki\Session\ImmutableSessionProviderWithCookie\getVaryCookies().
|
protected |
Definition at line 44 of file ImmutableSessionProviderWithCookie.php.
Referenced by MediaWiki\Session\ImmutableSessionProviderWithCookie\persistSession().