function CsrfTokenGenerator::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Access/CsrfTokenGenerator.php \Drupal\Core\Access\CsrfTokenGenerator::__construct()
  2. 10 core/lib/Drupal/Core/Access/CsrfTokenGenerator.php \Drupal\Core\Access\CsrfTokenGenerator::__construct()
  3. 9 core/lib/Drupal/Core/Access/CsrfTokenGenerator.php \Drupal\Core\Access\CsrfTokenGenerator::__construct()
  4. 8.9.x core/lib/Drupal/Core/Access/CsrfTokenGenerator.php \Drupal\Core\Access\CsrfTokenGenerator::__construct()

Constructs the token generator.

Parameters

\Drupal\Core\PrivateKey $privateKey: The private key service.

\Drupal\Core\Session\MetadataBag $sessionMetadata: The session metadata bag.

File

core/lib/Drupal/Core/Access/CsrfTokenGenerator.php, line 25

Class

CsrfTokenGenerator
Generates and validates CSRF tokens.

Namespace

Drupal\Core\Access

Code

public function __construct(protected PrivateKey $privateKey, protected MetadataBag $sessionMetadata) {
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.