code/dispatcher/authenticator/csrf.php
public function getToken()
    {
        if(!isset($this->__token))
        {
            $token   = false;
            $request = $this->getObject('request');

            if($request->headers->has('X-XSRF-Token')) {
                $token = $request->headers->get('X-XSRF-Token');
            }

            if($request->headers->has('X-CSRF-Token')) {
                $token = $request->headers->get('X-CSRF-Token');
            }

            if($request->data->has('csrf_token')) {
                $token = $request->data->get('csrf_token', 'sha1');
            }

            $this->__token = $token;
        }

        return $this->__token;
    }
public function getToken()
    {
        if(!isset($this->__token))
        {
            $token   = false;
            $request = $this->getObject('request');

            if($request->headers->has('X-XSRF-Token')) {
                $token = $request->headers->get('X-XSRF-Token');
            }

            if($request->headers->has('X-CSRF-Token')) {
                $token = $request->headers->get('X-CSRF-Token');
            }

            if($request->data->has('csrf_token')) {
                $token = $request->data->get('csrf_token', 'sha1');
            }

            $this->__token = $token;
        }

        return $this->__token;
    }
public function getToken ( ) { if ( ! isset ( $ this -> __token ) ) { $ token = false ; $ request = $ this -> getObject ( 'request' ) ; if ( $ request -> headers -> has ( 'X-XSRF-Token' ) ) { $ token = $ request -> headers -> get ( 'X-XSRF-Token' ) ; } if ( $ request -> headers -> has ( 'X-CSRF-Token' ) ) { $ token = $ request -> headers -> get ( 'X-CSRF-Token' ) ; } if ( $ request -> data -> has ( 'csrf_token' ) ) { $ token = $ request -> data -> get ( 'csrf_token' , 'sha1' ) ; } $ this -> __token = $ token ; } return $ this -> __token ; }
Return the CSRF request token

@return  string  The CSRF token or NULL if no token could be found
Return the CSRF request token