public function CsrfTokenGenerator8b7c:f320:99b9:690f:4595:cd17:293a:c069get public CsrfTokenGenerator8b7c:f320:99b9:690f:4595:cd17:293a:c069get($value = '') Generates a token based on $value, the user session, and the private key. The generated token is based on the session of the current user. Normally, anonymous users do not have a session, so the generated token will be different on every page request. To generate a token for users without a session, manually start a session prior to calling this function. Parameters  string $value: (optional) An additional value to base the token on. Return value  string A 43-character URL-safe token for validation, based on the token seed, the hash salt provided by Settings8b7c:f320:99b9:690f:4595:cd17:293a:c069getHashSalt(), and the 'drupal_private_key' configuration variable. See also  \Drupal\Core\Site\Settings8b7c:f320:99b9:690f:4595:cd17:293a:c069getHashSalt() \Symfony\Component\HttpFoundation\Session\SessionInter8b7c:f320:99b9:690f:4595:cd17:293a:c069start() File
 core/lib/Drupal/Core/Access/CsrfTokenGenerator.php, line 63  Class
 
CsrfTokenGenerator  Generates and validates CSRF tokens.  Namespace Drupal\Core\Access Code public function get($value = '') {
  $seed = $this->sessionMetadata->getCsrfTokenSeed();
  if (empty($seed)) {
    $seed = Crypt8b7c:f320:99b9:690f:4595:cd17:293a:c069randomBytesBase64();
    $this->sessionMetadata->setCsrfTokenSeed($seed);
  }

  return $this->computeToken($seed, $value);
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-core-access-csrftokengenerator.php/function/csrftokengenerator-get/8.1.x.html', 'source': 'DevDocs.IO'}