src/Core/Security/CsrfGuard.php
public function getToken($forceNew = false)
    {
        /** @var Session $session */
        $session = $this->session;

        $token = $session->get(static::TOKEN_KEY);

        // Create a token
        if ($token === null || $forceNew) {
            $token = $this->createToken(12);

            $session->set(static::TOKEN_KEY, $token);
        }

        return $token;
    }
public function getToken($forceNew = false)
    {
        /** @var Session $session */
        $session = $this->session;

        $token = $session->get(static::TOKEN_KEY);

        // Create a token
        if ($token === null || $forceNew) {
            $token = $this->createToken(12);

            $session->set(static::TOKEN_KEY, $token);
        }

        return $token;
    }
public function getToken ( $ forceNew = false ) { /** @var Session $session */ $ session = $ this -> session ; $ token = $ session -> get ( static :: TOKEN_KEY ) ; // Create a token if ( $ token === null || $ forceNew ) { $ token = $ this -> createToken ( 12 ) ; $ session -> set ( static :: TOKEN_KEY , $ token ) ; } return $ token ; }
Get form token string.

@param   boolean $forceNew Force create new token.

@return  string
@throws \UnexpectedValueException
@throws \RuntimeException
@throws \Exception
Get form token string .