CsrfTokenController::csrfToken

public CsrfTokenController::csrfToken()

Returns a CSRF protecting session token.

Return value

\Symfony\Component\HttpFoundation\Response The response object.

File

core/modules/system/src/Controller/CsrfTokenController.php, line 48

Class

CsrfTokenController
Returns responses for CSRF token routes.

Namespace

Drupal\system\Controller

Code

public function csrfToken() {
  return new Response($this->tokenGenerator->get(CsrfRequestHeaderAccessCheck::TOKEN_KEY), 200, ['Content-Type' => 'text/plain']);
}
doc_Drupal
2016-10-29 08:59:12
Comments
Leave a Comment

Please login to continue.