protected function _addTokenToRequest($token, ServerRequest $request)
    {
        $params = $request->getAttribute('params');
        $params['_csrfToken'] = $token;

        return $request->withAttribute('params', $params);
    }
protected function _addTokenToRequest($token, ServerRequest $request)
    {
        $params = $request->getAttribute('params');
        $params['_csrfToken'] = $token;

        return $request->withAttribute('params', $params);
    }
protected function _addTokenToRequest ( $ token , ServerRequest $ request ) { $ params = $ request -> getAttribute ( 'params' ) ; $ params [ '_csrfToken' ] = $ token ; return $ request -> withAttribute ( 'params' , $ params ) ; }
Add a CSRF token to the request parameters.

@param string $token The token to add.
@param \Cake\Http\ServerRequest $request The request to augment
@return \Cake\Http\ServerRequest Modified request
Add a CSRF token to the request parameters .