original_string: protected function _setCookie(ServerRequest $request, Response $response)
      {
          $expiry = new Time($this->_config['expiry']);
          $value = hash('sha512', Security::randomBytes(16), false);
  
          $request = $request->withParam('_csrfToken', $value);
  
          $cookie = new Cookie(
              $this->_config['cookieName'],
              $value,
              $expiry,
              $request->getAttribute('webroot'),
              '',
              (bool)$this->_config['secure'],
              (bool)$this->_config['httpOnly']
          );
  
          $response = $response->withCookie($cookie);
  
          return [$request, $response];
      }
code: protected function _setCookie(ServerRequest $request, Response $response)
      {
          $expiry = new Time($this->_config['expiry']);
          $value = hash('sha512', Security::randomBytes(16), false);
  
          $request = $request->withParam('_csrfToken', $value);
  
          $cookie = new Cookie(
              $this->_config['cookieName'],
              $value,
              $expiry,
              $request->getAttribute('webroot'),
              '',
              (bool)$this->_config['secure'],
              (bool)$this->_config['httpOnly']
          );
  
          $response = $response->withCookie($cookie);
  
          return [$request, $response];
      }
code_tokens: protected function _setCookie ( ServerRequest $ request , Response $ response ) { $ expiry = new Time ( $ this -> _config [ 'expiry' ] ) ; $ value = hash ( 'sha512' , Security :: randomBytes ( 16 ) , false ) ; $ request = $ request -> withParam ( '_csrfToken' , $ value ) ; $ cookie = new Cookie ( $ this -> _config [ 'cookieName' ] , $ value , $ expiry , $ request -> getAttribute ( 'webroot' ) , '' , ( bool ) $ this -> _config [ 'secure' ] , ( bool ) $ this -> _config [ 'httpOnly' ] ) ; $ response = $ response -> withCookie ( $ cookie ) ; return [ $ request , $ response ] ; }
docstring: Set the cookie in the response.
  
  Also sets the request->params['_csrfToken'] so the newly minted
  token is available in the request data.
  
  @param \Cake\Http\ServerRequest $request The request object.
  @param \Cake\Http\Response $response The response object.
  @return array An array of the modified request, response.
docstring_tokens: Set the cookie in the response .