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
1 2 3 | public function csrfToken() { return new Response( $this ->tokenGenerator->get(CsrfRequestHeaderAccessCheck::TOKEN_KEY), 200, [ 'Content-Type' => 'text/plain' ]); } |
Please login to continue.