W3cubDocs

/Drupal 8

public function CsrfTokenGenerator::__construct

public CsrfTokenGenerator::__construct(PrivateKey $private_key, MetadataBag $session_metadata)

Constructs the token generator.

Parameters

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

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

File

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

Class

CsrfTokenGenerator
Generates and validates CSRF tokens.

Namespace

Drupal\Core\Access

Code

public function __construct(PrivateKey $private_key, MetadataBag $session_metadata) {
  $this->privateKey = $private_key;
  $this->sessionMetadata = $session_metadata;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Access!CsrfTokenGenerator.php/function/CsrfTokenGenerator::__construct/8.1.x