ILIAS  release_8 Revision v8.23
class.ilCtrlToken.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /* Copyright (c) 2021 Thibeau Fuhrer <thf@studer-raimann.ch> Extended GPL, see docs/LICENSE */
6 
14 {
20  private string $token;
21 
27  public function __construct(string $token)
28  {
29  $this->token = $token;
30  }
31 
35  public function verifyWith(string $token): bool
36  {
37  return ($this->token === $token);
38  }
39 
43  public function getToken(): string
44  {
45  return $this->token;
46  }
47 }
verifyWith(string $token)
Class ilCtrlToken is responsible for generating and storing unique CSRF tokens.
Interface ilCtrlTokenInterface describes an ilCtrl token.
__construct(string $token)
ilCtrlToken Constructor