protected function generateCsrfToken()
    {
        $token = $this->app->getSecurity()->generateRandomString();
        if ($this->enableCsrfCookie) {
            $cookie = $this->createCsrfCookie($token);
            $this->app->getResponse()->getCookies()->add($cookie);
        } else {
            $this->app->getSession()->set($this->csrfParam, $token);
        }

        return $token;
    }
protected function generateCsrfToken()
    {
        $token = $this->app->getSecurity()->generateRandomString();
        if ($this->enableCsrfCookie) {
            $cookie = $this->createCsrfCookie($token);
            $this->app->getResponse()->getCookies()->add($cookie);
        } else {
            $this->app->getSession()->set($this->csrfParam, $token);
        }

        return $token;
    }
protected function generateCsrfToken ( ) { $ token = $ this -> app -> getSecurity ( ) -> generateRandomString ( ) ; if ( $ this -> enableCsrfCookie ) { $ cookie = $ this -> createCsrfCookie ( $ token ) ; $ this -> app -> getResponse ( ) -> getCookies ( ) -> add ( $ cookie ) ; } else { $ this -> app -> getSession ( ) -> set ( $ this -> csrfParam , $ token ) ; } return $ token ; }
Generates an unmasked random token used to perform CSRF validation.
@return string the random token for CSRF validation.
Generates an unmasked random token used to perform CSRF validation .