MediaWiki
1.28.0
|
A CookieSessionProvider persists sessions using cookies. More...
Public Member Functions | |
__construct ($params=[]) | |
canChangeUser () | |
getRememberUserDuration () | |
getVaryCookies () | |
persistSession (SessionBackend $session, WebRequest $request) | |
persistsSessionId () | |
provideSessionInfo (WebRequest $request) | |
setConfig (Config $config) | |
suggestLoginUsername (WebRequest $request) | |
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 | |
cookieDataToExport ($user, $remember) | |
Return the data to store in cookies. More... | |
getCookie ($request, $key, $prefix, $default=null) | |
Get a cookie. More... | |
getExtendedLoginCookies () | |
Gets the list of cookies that must be set to the 'remember me' duration, if $wgExtendedLoginCookieExpiration is in use. More... | |
getLoginCookieExpiration ($cookieName, $shouldRememberUser) | |
Returns the lifespan of the login cookies, in seconds. More... | |
getUserInfoFromCookies ($request) | |
Fetch the user identity from cookies. More... | |
sessionDataToExport ($user) | |
Return extra data to store in the session. More... | |
setForceHTTPSCookie ($set, SessionBackend $backend=null, WebRequest $request) | |
Set the "forceHTTPS" cookie. More... | |
setLoggedOutCookie ($loggedOut, WebRequest $request) | |
Set the "logged out" cookie. 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 | |
$cookieOptions = [] | |
$params = [] | |
Protected Attributes inherited from MediaWiki\Session\SessionProvider | |
Config | $config |
LoggerInterface | $logger |
SessionManager | $manager |
int | $priority |
Session priority. More... | |
A CookieSessionProvider persists sessions using cookies.
Definition at line 36 of file CookieSessionProvider.php.
MediaWiki\Session\CookieSessionProvider::__construct | ( | $params = [] | ) |
array | $params | Keys include:
|
Definition at line 54 of file CookieSessionProvider.php.
References MediaWiki\Session\CookieSessionProvider\$params, MediaWiki\Session\SessionInfo\MAX_PRIORITY, and MediaWiki\Session\SessionInfo\MIN_PRIORITY.
MediaWiki\Session\CookieSessionProvider::canChangeUser | ( | ) |
Definition at line 184 of file CookieSessionProvider.php.
|
protected |
Return the data to store in cookies.
User | $user | |
bool | $remember |
Definition at line 364 of file CookieSessionProvider.php.
Referenced by MediaWiki\Session\CookieSessionProvider\persistSession().
|
protected |
Get a cookie.
Contains an auth-specific hack.
\\WebRequest | $request | |
string | $key | |
string | $prefix | |
mixed | $default |
Definition at line 345 of file CookieSessionProvider.php.
References $request, and $value.
Referenced by MediaWiki\Session\CookieSessionProvider\getUserInfoFromCookies(), MediaWiki\Session\CookieSessionProvider\provideSessionInfo(), MediaWiki\Session\CookieSessionProvider\setLoggedOutCookie(), and MediaWiki\Session\CookieSessionProvider\suggestLoginUsername().
|
protected |
Gets the list of cookies that must be set to the 'remember me' duration, if $wgExtendedLoginCookieExpiration is in use.
Definition at line 413 of file CookieSessionProvider.php.
Referenced by MediaWiki\Session\CookieSessionProvider\getLoginCookieExpiration().
|
protected |
Returns the lifespan of the login cookies, in seconds.
0 means until the end of the session.
Cookies that are session-length do not call this function.
string | $cookieName | |
boolean | $shouldRememberUser | Whether the user should be remembered long-term |
Definition at line 427 of file CookieSessionProvider.php.
References MediaWiki\Session\CookieSessionProvider\getExtendedLoginCookies().
Referenced by MediaWiki\Session\CookieSessionProvider\getRememberUserDuration(), MediaWiki\Session\CookieSessionProvider\persistSession(), and MediaWiki\Session\CookieSessionProvider\setForceHTTPSCookie().
MediaWiki\Session\CookieSessionProvider::getRememberUserDuration | ( | ) |
Definition at line 402 of file CookieSessionProvider.php.
References MediaWiki\Session\CookieSessionProvider\getLoginCookieExpiration().
|
protected |
Fetch the user identity from cookies.
\\WebRequest | $request |
Definition at line 328 of file CookieSessionProvider.php.
References $request, and MediaWiki\Session\CookieSessionProvider\getCookie().
Referenced by MediaWiki\Session\CookieSessionProvider\provideSessionInfo().
MediaWiki\Session\CookieSessionProvider::getVaryCookies | ( | ) |
Definition at line 304 of file CookieSessionProvider.php.
MediaWiki\Session\CookieSessionProvider::persistSession | ( | SessionBackend | $session, |
WebRequest | $request | ||
) |
Definition at line 188 of file CookieSessionProvider.php.
References MediaWiki\Session\CookieSessionProvider\$cookieOptions, $options, $request, $response, $user, $value, MediaWiki\Session\SessionBackend\addData(), as, MediaWiki\Session\CookieSessionProvider\cookieDataToExport(), MediaWiki\Session\SessionBackend\getId(), MediaWiki\Session\SessionBackend\getLoggedOutTimestamp(), MediaWiki\Session\CookieSessionProvider\getLoginCookieExpiration(), MediaWiki\Session\SessionBackend\getUser(), WebRequest\response(), Hooks\run(), MediaWiki\Session\CookieSessionProvider\sessionDataToExport(), MediaWiki\Session\CookieSessionProvider\setForceHTTPSCookie(), MediaWiki\Session\CookieSessionProvider\setLoggedOutCookie(), MediaWiki\Session\SessionBackend\shouldForceHTTPS(), and MediaWiki\Session\SessionBackend\shouldRememberUser().
MediaWiki\Session\CookieSessionProvider::persistsSessionId | ( | ) |
Definition at line 180 of file CookieSessionProvider.php.
MediaWiki\Session\CookieSessionProvider::provideSessionInfo | ( | WebRequest | $request | ) |
Definition at line 105 of file CookieSessionProvider.php.
References MediaWiki\Session\CookieSessionProvider\getCookie(), MediaWiki\Session\CookieSessionProvider\getUserInfoFromCookies(), list, MediaWiki\Session\UserInfo\newAnonymous(), MediaWiki\Session\UserInfo\newFromId(), and MediaWiki\Session\SessionManager\validateSessionId().
|
protected |
Return extra data to store in the session.
User | $user |
Definition at line 384 of file CookieSessionProvider.php.
References $user.
Referenced by MediaWiki\Session\CookieSessionProvider\persistSession().
MediaWiki\Session\CookieSessionProvider::setConfig | ( | Config | $config | ) |
Definition at line 83 of file CookieSessionProvider.php.
References Config\get().
|
protected |
Set the "forceHTTPS" cookie.
bool | $set | Whether the cookie should be set or not |
SessionBackend | null | $backend | |
WebRequest | $request |
Definition at line 268 of file CookieSessionProvider.php.
References $response, MediaWiki\Session\CookieSessionProvider\getLoginCookieExpiration(), and WebRequest\response().
Referenced by MediaWiki\Session\CookieSessionProvider\persistSession(), and MediaWiki\Session\CookieSessionProvider\unpersistSession().
|
protected |
Set the "logged out" cookie.
int | $loggedOut | timestamp |
WebRequest | $request |
Definition at line 295 of file CookieSessionProvider.php.
References MediaWiki\Session\CookieSessionProvider\getCookie(), and WebRequest\response().
Referenced by MediaWiki\Session\CookieSessionProvider\persistSession().
MediaWiki\Session\CookieSessionProvider::suggestLoginUsername | ( | WebRequest | $request | ) |
Definition at line 315 of file CookieSessionProvider.php.
References $name, User\getCanonicalName(), and MediaWiki\Session\CookieSessionProvider\getCookie().
MediaWiki\Session\CookieSessionProvider::unpersistSession | ( | WebRequest | $request | ) |
Definition at line 238 of file CookieSessionProvider.php.
References $response, $value, as, WebRequest\response(), and MediaWiki\Session\CookieSessionProvider\setForceHTTPSCookie().
MediaWiki\Session\CookieSessionProvider::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 398 of file CookieSessionProvider.php.
References wfMessage().
|
protected |
Definition at line 39 of file CookieSessionProvider.php.
Referenced by MediaWiki\Session\CookieSessionProvider\persistSession().
|
protected |
Definition at line 38 of file CookieSessionProvider.php.
Referenced by MediaWiki\Session\CookieSessionProvider\__construct().