Manual:$wgSessionProviders

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎español • ‎日本語 • ‎polski • ‎português
Authentication: $wgSessionProviders
Session provider configuration.
Introduced in version: 1.27.0 (Gerrit change 243223; git #a73c5b73)
Removed in version: still in use
Allowed values: array of ObjectFactoryObjectFactory specifications
Default value: see below
Other settings: Alphabetical | By function

Details[edit]

Specifies what providers to use for SessionManagerSessionManager. By default, CookieSessionProvider (for normal cookie-based authentication) and BotPasswordSessionProvider (for bot passwords) are included.

Order and array keys are not relevant. By convention, the array key is the classname of the provider.

Example[edit]

$wgSessionProviders[] = [
    'MyCustomSessionProvider' => [
        'class' => 'MyCustomSessionProvider',
        'args' => [ 'arg1', 'arg2' ],
    ],
];

or, if the extension uses extension registration (preferable):

{
    //...
    "SessionProviders": {
        "MyCustomSessionProvider": {
            "class": "MyCustomSessionProvider",
            "args": [ "arg1", "arg2" ]
    },
    //...
}

This will create a session provider object with new MyCustomSessionProvider( 'arg1', 'arg2' ), and register it as one of the session providers. See ObjectFactoryObjectFactory for details of the object construction syntax.

See also[edit]