public CsrfTokenGenerator::validate($token, $value = '')
Validates a token based on $value, the user session, and the private key.
string $token: The token to be validated.
string $value: (optional) An additional value to base the token on.
bool TRUE for a valid token, FALSE for an invalid token.
public function validate($token, $value = '') { $seed = $this->sessionMetadata->getCsrfTokenSeed(); if (empty($seed)) { return FALSE; } return $token === $this->computeToken($seed, $value); }
© 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::validate/8.1.x