Skip to content
Permalink
Browse files

Remove response from CookieComponent.

Also remove duplicate property definition that we don't need.
  • Loading branch information...
markstory committed Nov 20, 2016
1 parent 8081b72 commit ab4a4716cd3fe2c547c222ab1060093003424e86
@@ -101,9 +101,11 @@ class CookieComponent extends Component
protected $_loaded = [];
/**
* A reference to the Controller's Cake\Network\Response object
* A reference to the Controller's Cake\Network\Response object.
* Currently unused.
*
* @var \Cake\Network\Response
* @deprecated 3.4.0 Will be removed in 4.0.0
*/
protected $_response = null;
@@ -121,13 +123,8 @@ public function initialize(array $config)
$controller = $this->_registry->getController();
if ($controller !== null) {
$this->_response =& $controller->response;
}
if ($controller === null) {
$this->request = ServerRequest::createFromGlobals();
$this->_response = new Response();
}
if (empty($this->_config['path'])) {
@@ -312,7 +309,8 @@ protected function _write($name, $value)
$config = $this->configKey($name);
$expires = new Time($config['expires']);
$this->_response->cookie([
$response = $this->getController()->response;
$response->cookie([
'name' => $name,
'value' => $this->_encrypt($value, $config['encryption'], $config['key']),
'expire' => $expires->format('U'),
@@ -337,7 +335,8 @@ protected function _delete($name)
$config = $this->configKey($name);
$expires = new Time('now');
$this->_response->cookie([
$response = $this->getController()->response;
$response->cookie([
'name' => $name,
'value' => '',
'expire' => $expires->format('U') - 42000,
@@ -46,14 +46,6 @@ class RequestHandlerComponent extends Component
*/
public $enabled = true;
/**
* Holds the reference to Controller::$response
*
* @var \Cake\Network\Response
* @deprecated 3.4.0 Will be removed in 4.0.0
*/
public $response;
/**
* Contains the file extension parsed out by the Router
*

0 comments on commit ab4a471

Please sign in to comment.
You can’t perform that action at this time.