From 3a606a0a2019f495716670e0572c8827b7a95d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Evrens?= Date: Thu, 14 Jan 2016 10:14:53 +0200 Subject: [PATCH 1/3] Added hostOnly key. True if the cookie is a host-only cookie. --- Slim/Http/Cookies.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Slim/Http/Cookies.php b/Slim/Http/Cookies.php index a1f1561a1..6d3246fd3 100644 --- a/Slim/Http/Cookies.php +++ b/Slim/Http/Cookies.php @@ -38,6 +38,7 @@ class Cookies implements CookiesInterface protected $defaults = [ 'value' => '', 'domain' => null, + 'hostonly' => null, 'path' => null, 'expires' => null, 'secure' => false, From 6138ec85372fd74df8aaec7c0f7062d2fc2ac8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Evrens?= Date: Thu, 14 Jan 2016 10:19:10 +0200 Subject: [PATCH 2/3] Added HostOnly option to toHeader function. --- Slim/Http/Cookies.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Slim/Http/Cookies.php b/Slim/Http/Cookies.php index 6d3246fd3..0604f81ae 100644 --- a/Slim/Http/Cookies.php +++ b/Slim/Http/Cookies.php @@ -141,6 +141,10 @@ protected function toHeader($name, array $properties) if (isset($properties['secure']) && $properties['secure']) { $result .= '; secure'; } + + if (isset($properties['hostonly']) && $properties['hostonly']) { + $result .= '; HostOnly'; + } if (isset($properties['httponly']) && $properties['httponly']) { $result .= '; HttpOnly'; From afee3dbe8665111af2f2d9b2c8727e4c9669a5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Evrens?= Date: Thu, 14 Jan 2016 10:24:25 +0200 Subject: [PATCH 3/3] fixed test. --- tests/Http/CookiesTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Http/CookiesTest.php b/tests/Http/CookiesTest.php index 6e4f4af23..80bf93169 100644 --- a/tests/Http/CookiesTest.php +++ b/tests/Http/CookiesTest.php @@ -96,6 +96,7 @@ public function testSetDefaults() $defaults = [ 'value' => 'toast', 'domain' => null, + 'hostonly' => null, 'path' => null, 'expires' => null, 'secure' => true,