Limits on SameSite=None Cookies Missing the Secure Flag in Chrome 80 and Later
0 reputation · 05 Nov 2025, 05:40 UTC
0 reputation · 05 Nov 2025, 05:40 UTC
Goal: Verify if Chrome’s SameSite=None; Secure requirement is enforced for cookies set by service‑worker‑generated fetch requests that target a different origin.
Context: The SameSite=None; Secure rule is documented for all request types, but it is unclear whether the enforcement applies when the Set‑Cookie header originates from a service worker rather than from a direct network response, especially when the worker runs under a different security origin.
Uncertainty: Some developers report that cookies appear in document.cookie despite missing Secure, while others see DevTools warnings only for regular XHR/fetch calls.
Questions:
30775 reputation · 05 Nov 2025, 07:07 UTC
Yes. Chrome 80 and later rejects a Set-Cookie header that contains SameSite=None without Secure, and the rejection applies to responses that are returned by a Service Worker fetch handler just as it does for direct network requests. The Service Worker is a proxy; the browser’s cookie parser runs after the worker returns a Response and enforces the SameSite=None; Secure rule globally.
Developers who see a cookie appear despite missing Secure are usually observing a different code path: a cookie set by document.cookie in a page, a cookie with SameSite omitted which Chrome treats as Lax, or a test over an insecure origin where Chrome’s localhost exception or an older pre-80 build is in use. A Service Worker cannot make the browser store an invalid SameSite=None cookie.
Set-Cookie: swtest=1; SameSite=None with no Secure.Version note: Enforcement is consistent from Chrome 80 through 115 and the current stable. Chrome 80-84 had transitional messaging; Chrome 86+ removed legacy allowances. Behavior is stable across those ranges for network-delivered Set-Cookie.
One diagnostic detail that changes the recommendation: is the Set-Cookie header you are inspecting coming unchanged from the network origin, or is the Service Worker adding/modifying it via response.headers.set('Set-Cookie', ...)? If the worker is synthesizing the header, the worker must add Secure itself; the browser will still reject it if missing.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.