diff --git a/src/Cookies.php b/src/Cookies.php index 044d438..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'; } } 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' => [