MediaWiki
1.30.0
|
Value object returned by SessionProvider. More...
Public Member Functions | |
__construct ( $priority, array $data) | |
__toString () | |
forceHTTPS () | |
Whether this session should only be used over HTTPS. More... | |
forceUse () | |
Force use of this SessionInfo if validation fails. More... | |
getId () | |
Return the session ID. More... | |
getPriority () | |
Return the priority. More... | |
getProvider () | |
Return the provider. More... | |
getProviderMetadata () | |
Return provider metadata. More... | |
getUserInfo () | |
Return the user. More... | |
isIdSafe () | |
Indicate whether the ID is "safe". More... | |
wasPersisted () | |
Return whether the session is persisted. More... | |
wasRemembered () | |
Return whether the user was remembered. More... | |
Static Public Member Functions | |
static | compare ( $a, $b) |
Compare two SessionInfo objects by priority. More... | |
Public Attributes | |
const | MAX_PRIORITY = 100 |
Maximum allowed priority. More... | |
const | MIN_PRIORITY = 1 |
Minimum allowed priority. More... | |
Private Attributes | |
$forceHTTPS = false | |
$forceUse = false | |
string | $id |
$idIsSafe = false | |
$persisted = false | |
int | $priority |
SessionProvider null | $provider |
array null | $providerMetadata = null |
$remembered = false | |
UserInfo null | $userInfo = null |
Value object returned by SessionProvider.
This holds the data necessary to construct a Session.
Definition at line 34 of file SessionInfo.php.
MediaWiki\Session\SessionInfo::__construct | ( | $priority, | |
array | $data | ||
) |
int | $priority | Session priority |
array | $data |
|
Definition at line 87 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$priority, MediaWiki\Session\SessionInfo\$provider, MediaWiki\Session\SessionInfo\forceHTTPS(), MediaWiki\Session\SessionInfo\forceUse(), MediaWiki\Session\SessionProvider\getManager(), and MediaWiki\Session\SessionManager\validateSessionId().
MediaWiki\Session\SessionInfo::__toString | ( | ) |
Definition at line 272 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\getId(), MediaWiki\Session\SessionInfo\getPriority(), and MediaWiki\Session\SessionInfo\getProvider().
|
static |
Compare two SessionInfo objects by priority.
SessionInfo | $a | |
SessionInfo | $b |
Definition at line 284 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionManager\getEmptySessionInternal(), MediaWiki\Session\SessionManager\getSessionInfoForRequest(), and MediaWiki\Session\SessionInfoTest\testCompare().
|
final |
Whether this session should only be used over HTTPS.
Definition at line 268 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$forceHTTPS.
Referenced by MediaWiki\Session\SessionInfo\__construct(), MediaWiki\Session\SessionBackend\__construct(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Force use of this SessionInfo if validation fails.
The normal behavior is to discard the SessionInfo if validation against the data stored in the session store fails. If this returns true, SessionManager will instead delete the session store data so this SessionInfo may still be used. This is important for providers which use deterministic IDs and so cannot just generate a random new one.
Definition at line 209 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$forceUse.
Referenced by MediaWiki\Session\SessionInfo\__construct(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Return the session ID.
Definition at line 178 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$id.
Referenced by MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\SessionInfo\__toString(), MediaWiki\Session\SessionManager\getSessionFromInfo(), MediaWiki\Session\SessionManager\loadSessionInfoFromStore(), and MediaWiki\Session\SessionManagerTest\testGetSessionForRequest().
|
final |
Return the priority.
Definition at line 217 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$priority.
Referenced by MediaWiki\Session\SessionInfo\__toString(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Return the provider.
Definition at line 170 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$provider.
Referenced by MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\SessionInfo\__toString(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Return provider metadata.
Definition at line 241 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$providerMetadata.
Referenced by MediaWiki\Session\SessionBackend\__construct(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Return the user.
Definition at line 225 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$userInfo.
Referenced by MediaWiki\Session\SessionBackend\__construct(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Indicate whether the ID is "safe".
The ID is safe in the following cases:
Definition at line 194 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$idIsSafe.
Referenced by MediaWiki\Session\SessionManager\getSessionFromInfo(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Return whether the session is persisted.
Definition at line 233 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$persisted.
Referenced by MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\SessionManager\getSessionFromInfo(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
final |
Return whether the user was remembered.
For providers that can persist the user separately from the session, the human using it may not actually want that to be done. For example, a cookie-based provider can set cookies that are longer-lived than the backend session data, but on a public terminal the human likely doesn't want those cookies set.
This is false unless a non-anonymous verified user was passed to the SessionInfo constructor by the provider, and the provider didn't pass false for the 'remembered' data item.
Definition at line 260 of file SessionInfo.php.
References MediaWiki\Session\SessionInfo\$remembered.
Referenced by MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\SessionManager\getSessionFromInfo(), and MediaWiki\Session\SessionManager\loadSessionInfoFromStore().
|
private |
Definition at line 55 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\forceHTTPS().
|
private |
Definition at line 57 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\forceUse().
|
private |
Definition at line 45 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\getId().
|
private |
Definition at line 56 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\isIdSafe().
|
private |
Definition at line 53 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\wasPersisted().
|
private |
Definition at line 48 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\__construct(), and MediaWiki\Session\SessionInfo\getPriority().
|
private |
Definition at line 42 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\__construct(), and MediaWiki\Session\SessionInfo\getProvider().
|
private |
Definition at line 60 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\getProviderMetadata().
|
private |
Definition at line 54 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\wasRemembered().
|
private |
Definition at line 51 of file SessionInfo.php.
Referenced by MediaWiki\Session\SessionInfo\getUserInfo().
const MediaWiki\Session\SessionInfo::MAX_PRIORITY = 100 |
Maximum allowed priority.
Definition at line 39 of file SessionInfo.php.
Referenced by MediaWiki\Session\Session\BotPasswordSessionProvider\__construct(), MediaWiki\Session\CookieSessionProvider\__construct(), MediaWiki\Session\Session\BotPasswordSessionProvider\newSessionForRequest(), MediaWiki\Session\SessionInfoTest\testBasics(), MediaWiki\Session\CookieSessionProviderTest\testConstructor(), MediaWiki\Session\BotPasswordSessionProviderTest\testConstructor(), and MediaWiki\Session\SessionManagerTest\testGetSessionForRequest().
const MediaWiki\Session\SessionInfo::MIN_PRIORITY = 1 |
Minimum allowed priority.
Definition at line 36 of file SessionInfo.php.
Referenced by MediaWiki\Session\Session\BotPasswordSessionProvider\__construct(), MediaWiki\Session\CookieSessionProvider\__construct(), MediaWiki\Session\SessionProvider\__construct(), MediaWiki\Session\SessionBackendTest\getBackend(), MediaWiki\Session\SessionManager\getSessionById(), MediaWiki\Session\SessionInfoTest\testBasics(), MediaWiki\Session\SessionProviderTest\testBasics(), MediaWiki\Session\BotPasswordSessionProviderTest\testCheckSessionInfo(), MediaWiki\Session\SessionInfoTest\testCompare(), MediaWiki\Session\CookieSessionProviderTest\testConstructor(), MediaWiki\Session\SessionBackendTest\testConstructor(), MediaWiki\Session\BotPasswordSessionProviderTest\testConstructor(), MediaWiki\Session\CookieSessionProviderTest\testCookieData(), MediaWiki\Session\SessionManagerTest\testGetEmptySession(), MediaWiki\Session\SessionManagerTest\testGetSessionForRequest(), MediaWiki\Session\SessionManagerTest\testGetSessionFromInfo(), MediaWiki\Session\SessionManagerTest\testLoadSessionInfoFromStore(), MediaWiki\Session\ImmutableSessionProviderWithCookieTest\testPersistSession(), MediaWiki\Session\CookieSessionProviderTest\testPersistSession(), MediaWiki\Session\CookieSessionProviderTest\testPersistSessionWithHook(), and MediaWiki\Auth\AuthManagerTest\testSecuritySensitiveOperationStatus().