From 61b2a36bcf73dc65e6e96fb82cc80d068a134a56 Mon Sep 17 00:00:00 2001 From: Adam Meyer Date: Thu, 28 Aug 2025 16:35:56 -0400 Subject: [PATCH 1/3] correct date format for cookie expire --- src/Cookies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cookies.php b/src/Cookies.php index 044d438..434b873 100644 --- a/src/Cookies.php +++ b/src/Cookies.php @@ -148,7 +148,7 @@ protected function toHeader(string $name, array $properties): string $timestamp = (int) $properties['expires']; } if ($timestamp && $timestamp !== 0) { - $result .= '; expires=' . gmdate('D, d-M-Y H:i:s e', $timestamp); + $result .= '; expires=' . gmdate('D, d M Y H:i:s e', $timestamp); } } From be7b4c02c1bb3bcec48e71fc5b5847eee1f24d72 Mon Sep 17 00:00:00 2001 From: Adam Meyer Date: Thu, 28 Aug 2025 16:49:32 -0400 Subject: [PATCH 2/3] use GMT instead of UTC --- src/Cookies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cookies.php b/src/Cookies.php index 434b873..9be7453 100644 --- a/src/Cookies.php +++ b/src/Cookies.php @@ -148,7 +148,7 @@ protected function toHeader(string $name, array $properties): string $timestamp = (int) $properties['expires']; } if ($timestamp && $timestamp !== 0) { - $result .= '; expires=' . gmdate('D, d M Y H:i:s e', $timestamp); + $result .= '; expires=' . gmdate('D, d M Y H:i:s', $timestamp) . ' GMT'; } } From 9f118ef7956543ca48ee5d1ec83ea4db19f5ede4 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Sun, 2 Nov 2025 16:14:32 +0000 Subject: [PATCH 3/3] Update test for correctly formatted date --- tests/CookiesTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CookiesTest.php b/tests/CookiesTest.php index d365ac1..4a9d1a0 100644 --- a/tests/CookiesTest.php +++ b/tests/CookiesTest.php @@ -242,7 +242,7 @@ public function testToHeader() ] ]; $time = time(); - $formattedDate = gmdate('D, d-M-Y H:i:s e', $time); + $formattedDate = gmdate('D, d M Y H:i:s \G\M\T', $time); $propertiesComplex = [ 'name' => 'test_complex', 'properties' => [ @@ -257,7 +257,7 @@ public function testToHeader() ] ]; $stringDate = '2016-01-01 12:00:00'; - $formattedStringDate = gmdate('D, d-M-Y H:i:s e', strtotime($stringDate)); + $formattedStringDate = gmdate('D, d M Y H:i:s \G\M\T', strtotime($stringDate)); $propertiesStringDate = [ 'name' => 'test_date', 'properties' => [