From cafe1ab7e328815d528647ab6a8e2b82c5f4a0dd Mon Sep 17 00:00:00 2001 From: Akashdeep Singh Date: Sun, 19 Oct 2025 20:46:57 +0530 Subject: [PATCH] Add documentation for Expires attribute in Set-Cookie Document the Expires attribute in Set-Cookie headers. Adds documentation for the valid RFC 6265 date format used by the Expires attribute in Set-Cookie headers. Fixes #2641. --- packages/hint-http-cache/src/expires-header.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 packages/hint-http-cache/src/expires-header.md diff --git a/packages/hint-http-cache/src/expires-header.md b/packages/hint-http-cache/src/expires-header.md new file mode 100644 index 00000000000..88c6c19a101 --- /dev/null +++ b/packages/hint-http-cache/src/expires-header.md @@ -0,0 +1,10 @@ +# Expires attribute in `Set-Cookie` headers + +The `Expires` attribute in a `Set-Cookie` header defines when the cookie should expire. + +It must follow the **RFC 6265** date format: + +⚠️ **Notes:** +- The date must use the `GMT` timezone. +- Invalid formats or missing timezone cause browsers to ignore the cookie. +- When using `Max-Age`, `Expires` may be omitted.