MediaWiki REL1_34
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}
__construct()
Protected constructor: no creating instances except through the factory method above.
clear( $index)
Delete a result once the captcha has been used, so it cannot be reused.
cookiesNeeded()
Whether this type of CaptchaStore needs cookies.
retrieve( $index)
Retrieve the answer for a given captcha.
store( $index, $info)
Store the correct answer for a given captcha.
This serves as the entry point to the MediaWiki session handling system.