MediaWiki  1.34.4
CaptchaSessionStore.php
Go to the documentation of this file.
1 <?php
2 
4 
6  protected function __construct() {
7  // Make sure the session is started
8  SessionManager::getGlobalSession()->persist();
9  }
10 
11  public function store( $index, $info ) {
12  SessionManager::getGlobalSession()->set( 'captcha' . $index, $info );
13  }
14 
15  public function retrieve( $index ) {
16  return SessionManager::getGlobalSession()->get( 'captcha' . $index, false );
17  }
18 
19  public function clear( $index ) {
20  SessionManager::getGlobalSession()->remove( 'captcha' . $index );
21  }
22 
23  public function cookiesNeeded() {
24  return true;
25  }
26 }
CaptchaSessionStore\__construct
__construct()
Protected constructor: no creating instances except through the factory method above.
Definition: CaptchaSessionStore.php:6
CaptchaSessionStore
Definition: CaptchaSessionStore.php:5
CaptchaSessionStore\store
store( $index, $info)
Store the correct answer for a given captcha.
Definition: CaptchaSessionStore.php:11
CaptchaSessionStore\cookiesNeeded
cookiesNeeded()
Whether this type of CaptchaStore needs cookies.
Definition: CaptchaSessionStore.php:23
CaptchaStore
Definition: CaptchaStore.php:3
MediaWiki\Session\SessionManager
This serves as the entry point to the MediaWiki session handling system.
Definition: SessionManager.php:50
CaptchaSessionStore\clear
clear( $index)
Delete a result once the captcha has been used, so it cannot be reused.
Definition: CaptchaSessionStore.php:19
CaptchaSessionStore\retrieve
retrieve( $index)
Retrieve the answer for a given captcha.
Definition: CaptchaSessionStore.php:15