Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix incorrect type matching in Response::cookie()
  • Loading branch information
markstory committed Apr 7, 2017
1 parent d6c201c commit 5502e39
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Http/Response.php
Expand Up @@ -1942,7 +1942,7 @@ public function cookie($options = null)
return $this->_cookies->get($options)->toArrayResponse();
}

$defaults = [
$options += [
'name' => 'CakeCookie[default]',
'value' => '',
'expire' => 0,
Expand All @@ -1951,11 +1951,10 @@ public function cookie($options = null)
'secure' => false,
'httpOnly' => false
];
$options += $defaults;
$cookie = new Cookie(
$options['name'],
$options['value'],
$options['expire'],
(int)$options['expire'],
$options['path'],
$options['domain'],
$options['secure'],
Expand Down Expand Up @@ -2013,7 +2012,7 @@ public function withCookie($name, $data = '')
$cookie = new Cookie(
$name,
$data['value'],
$data['expire'],
(int)$data['expire'],
$data['path'],
$data['domain'],
$data['secure'],
Expand Down

0 comments on commit 5502e39

Please sign in to comment.