Manual:Hooks/SessionCheckInfo
Appearance
SessionCheckInfo | |
---|---|
Available from version 1.27.0 (Gerrit change 243223) Validate session info as it's being loaded from storage. | |
Define function: | public static function onSessionCheckInfo( &$reason, $info, $request, $metadata, $data ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"SessionCheckInfo": "MediaWiki\\Extension\\MyExtension\\Hooks::onSessionCheckInfo"
}
}
|
Called from: | File(s): session/SessionManager.php Function(s): loadSessionInfoFromStore |
Interface: | SessionCheckInfoHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:SessionCheckInfo extensions.
Details
[edit]- &$reason: (string) rejection reason to be logged
- $info: SessionInfo being validated
- $request: WebRequest being loaded from
- $metadata: (array|false) metadata array for the Session
- $data: (array|false) data array for the Session
This hook is used to validate the current request against session metadata added by the SessionMetadata hook. To reject the session, set $reason
and return false.
A SessionProvider checking metadata for its own session does not need this hook; it should use its refreshSessionInfo()
method instead.