2 use MediaWiki\Session\SessionProvider
;
3 use MediaWiki\Session\SessionInfo
;
4 use MediaWiki\Session\SessionBackend
;
5 use MediaWiki\Session\UserInfo
;
8 * Dummy session provider
10 * An implementation of a session provider that doesn't actually do anything.
12 class DummySessionProvider
extends SessionProvider
{
14 const ID
= 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
16 public function provideSessionInfo( WebRequest
$request ) {
17 return new SessionInfo( SessionInfo
::MIN_PRIORITY
, [
21 'userInfo' => UserInfo
::newAnonymous(),
25 public function newSessionInfo( $id = null ) {
26 return new SessionInfo( SessionInfo
::MIN_PRIORITY
, [
31 'userInfo' => UserInfo
::newAnonymous(),
35 public function persistsSessionId() {
39 public function canChangeUser() {
40 return $this->persistsSessionId();
43 public function persistSession( SessionBackend
$session, WebRequest
$request ) {
46 public function unpersistSession( WebRequest
$request ) {
49 public function immutableSessionCouldExistForUser( $user ) {
53 public function preventImmutableSessionsForUser( $user ) {
56 public function suggestLoginUsername( WebRequest
$request ) {
57 return $request->getCookie( 'UserName' );