src/Core/Security/CsrfGuard.php
public function getFormToken($userId = null, $forceNew = false)
    {
        $userId = $userId ?: $this->userManager->getUser()->id;
        $userId = $userId ?: $this->session->getId();

        $config = $this->config;

        return md5($config['system.secret'] . $userId . $this->getToken($forceNew));
    }
public function getFormToken($userId = null, $forceNew = false)
    {
        $userId = $userId ?: $this->userManager->getUser()->id;
        $userId = $userId ?: $this->session->getId();

        $config = $this->config;

        return md5($config['system.secret'] . $userId . $this->getToken($forceNew));
    }
public function getFormToken ( $ userId = null , $ forceNew = false ) { $ userId = $ userId ? : $ this -> userManager -> getUser ( ) -> id ; $ userId = $ userId ? : $ this -> session -> getId ( ) ; $ config = $ this -> config ; return md5 ( $ config [ 'system.secret' ] . $ userId . $ this -> getToken ( $ forceNew ) ) ; }
Get a token for specific user.

@param   mixed   $userId   An identify of current user.
@param   boolean $forceNew Force create new token.

@return string
@throws \RuntimeException
@throws \UnexpectedValueException
@throws \Exception
Get a token for specific user .