Skip to content

Commit f34c8f6

Browse files
committed
Remove use of deprecated DATE_RFC7231 constant
1 parent b305d85 commit f34c8f6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Nexus/Cookie/Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function __toString(): string
184184

185185
if (0 !== $this->expires) {
186186
$cookieParts[] = \sprintf('Max-Age=%d', $this->getMaxAge());
187-
$cookieParts[] = \sprintf('Expires=%s', gmdate(DATE_RFC7231, $this->expires));
187+
$cookieParts[] = \sprintf('Expires=%s', gmdate(self::EXPIRES_FORMAT, $this->expires));
188188
}
189189
}
190190

src/Nexus/Cookie/CookieInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
*/
1919
interface CookieInterface extends \Stringable
2020
{
21+
/**
22+
* RFC 7231 compliant date format for cookie expiration.
23+
*/
24+
public const EXPIRES_FORMAT = 'D, d M Y H:i:s T';
25+
2126
/**
2227
* Cookies will be sent in all contexts, i.e in responses to both
2328
* first-party and cross-origin requests. If `SameSite=None` is set,

0 commit comments

Comments
 (0)