function CsrfRequestHeaderAccessCheck::__construct

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

Constructs a new rest CSRF access check.

Parameters

\Drupal\Core\Session\SessionConfigurationInterface $session_configuration: The session configuration.

\Drupal\Core\Access\CsrfTokenGenerator $csrf_token: The token generator.

File

core/lib/Drupal/Core/Access/CsrfRequestHeaderAccessCheck.php, line 42

Class

CsrfRequestHeaderAccessCheck
Access protection against CSRF attacks.

Namespace

Drupal\Core\Access

Code

public function __construct(SessionConfigurationInterface $session_configuration, CsrfTokenGenerator $csrf_token) {
    $this->sessionConfiguration = $session_configuration;
    $this->csrfToken = $csrf_token;
}

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