3 use MediaWiki\Request\WebRequest
;
4 use MediaWiki\Session\SessionBackend
;
5 use MediaWiki\Session\SessionInfo
;
6 use MediaWiki\Session\SessionProvider
;
7 use MediaWiki\Session\UserInfo
;
10 * Dummy session provider
12 * An implementation of a session provider that doesn't actually do anything.
14 class DummySessionProvider
extends SessionProvider
{
16 public const ID
= 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
18 public function provideSessionInfo( WebRequest
$request ) {
19 return new SessionInfo( SessionInfo
::MIN_PRIORITY
, [
23 'userInfo' => UserInfo
::newAnonymous(),
27 public function newSessionInfo( $id = null ) {
28 return new SessionInfo( SessionInfo
::MIN_PRIORITY
, [
33 'userInfo' => UserInfo
::newAnonymous(),
37 public function persistsSessionId() {
41 public function canChangeUser() {
42 return $this->persistsSessionId();
45 public function persistSession( SessionBackend
$session, WebRequest
$request ) {
48 public function unpersistSession( WebRequest
$request ) {
51 public function immutableSessionCouldExistForUser( $user ) {
55 public function preventImmutableSessionsForUser( $user ) {
58 public function suggestLoginUsername( WebRequest
$request ) {
59 return $request->getCookie( 'UserName' );