- From: Lily Chen <chlily@chromium.org>
- Date: Wed, 1 Jul 2026 17:17:13 -0400
- To: Xyan Bhatnagar <xyanb@apple.com>
- Cc: Lily Chen <chlily@chromium.org>, Mike West <mkwst@google.com>, Daniel Veditz <dveditz@mozilla.com>, HTTP Working Group <ietf-http-wg@w3.org>
- Message-ID: <CAE24OxxQWPY7UAuA0hyZQbU9kTNp5GYrgAVyq=nxNe6y3-s2Tg@mail.gmail.com>
I had looked into some metrics on the Chromium side and summarized some findings in https://crbug.com/434825208#comment43. On Wed, Jul 1, 2026 at 4:55 PM Xyan Bhatnagar <xyanb@apple.com> wrote: > In my head, there is a significant difference between a cookie like `foo` > and `=foo`. Both are considered nameless, but I’m wondering if they should > be treated differently. > > Case A: `foo` (ambiguous cookie) > > - This is treated by PHP, Safari and Firefox as a valueless cookie > with name `foo`. > - Chrome treats it as a nameless cookie with value `foo`. > > > There is an open-ended question here of how it is interpreted, which we > should figure out together. > > On the one hand, I see the merit of keeping these as nameless cookies, > such that one entry in the cookie jar is where they all end up, to avoid > jar pollution. > > On the other hand, I’m also concerned about subtle vulnerabilities from > treating them as nameless cookies. > > As described in https://github.com/httpwg/http-extensions/issues/2229 > (section called “Client/Server confusion: cookie tossing”), it is possible > for a malicious actor to use a nameless cookie to override a `__Host-` > cookie in specific backends like PHP. I see that this kind of > vulnerability was already discovered in Chromium ( > https://issues.chromium.org/issues/40060319) and corrected by explicitly > rejecting `__Host-` prefixes in nameless cookies. > > > Case B: `=foo` (intentional nameless cookie) > > - This cookie is rejected by both Safari and Firefox. > - Chrome treats it as a nameless cookie with value `foo`. > - According to https://github.com/httpwg/http-extensions/issues/2229, > PHP would have also rejected such a cookie, if it were sent as `Cookie: > =foo`. That doesn't happen because of the RFC spec which says the `=` > should be omitted from a nameless cookie. > > > Here, the unambiguous intention of the server is to store a nameless > cookie. I would be surprised if there is an intentional use of this kind of > nameless cookie, but the internet is a large place and I’ve not seen all of > it :) It would be great to have metrics on how common this specific case > is, to better inform our decisions. > > > > > On Jul 1, 2026, at 10:53 AM, Lily Chen <chlily@chromium.org> wrote: > > It seems this behavior has diverged somewhat. I wrote down what I observed > from Wpt.fyi runs recently in this thread: > https://groups.google.com/a/chromium.org/g/blink-dev/c/SQUdQBMJqDk/m/Zoa60pYfCwAJ?utm_medium=email&utm_source=footer > > I'm supportive of eliminating nameless cookies, but share your concerns > Mike. > > In particular, the possible world in which "Set-Cookie: foo" is > consistently parsed into a valueless cookie named foo (rather than a > nameless cookie holding value foo, as Chromium does currently) seems > slightly problematic to me from the perspective of leaving behind many such > cookies littering the domain's cookie jar, which the server may not > understand how to clear. The fact that there is only one nameless cookie > that is overwritten by subsequent sets seems convenient here. > > Lily > > On Wed, Jul 1, 2026, 1:40 PM Mike West <mkwst@google.com> wrote: > >> Looking briefly at Chrome's telemetry over the past ~month, we see ~0.02% >> of cookie parsing actions resulting in a nameless cookie: of those, about >> half are known tokens (`HttpOnly`, `Secure`, etc) or explicitly nameless >> values (e.g. `=value`). So, ~0.01% of cookie parsing actions aren't >> something that can be easily categorized as mistakes. >> >> I'm enthusiastic about ending support for nameless cookies from a >> philosophical perspective. I'm less enthusiastic about doing so from a >> practical perspective, as 0.01% of all cookie parsing is still a pretty >> high level of potential breakage if we changed the behavior. +Lily Chen >> <chlily@chromium.org> who made some changes in this space relatively >> recently, as they might have a more nuanced opinion. :) >> >> For clarity, though: what is the behavior Safari and Firefox have aligned >> on for `Set-Cookie: foo`? Is it rejected entirely? Do you set a cookie with >> an empty value named `foo`? >> >> -mike >> >> >> On Sat, Jun 27, 2026 at 5:29 AM Daniel Veditz <dveditz@mozilla.com> >> wrote: >> >>> On Thu, Jun 25, 2026 at 1:38 PM Xyan Bhatnagar <xyanb@apple.com> wrote: >>> >>>> Safari has rejected nameless cookies for a while now. What are the >>>> observed use-cases of nameless cookies? Does anyone know of servers that >>>> send out such cookies and the motivations for doing so? >>>> >>> >>> The main issue faced by the original rfc6265 was that sometimes servers >>> sent `Set-Cookie: foo` instead of a "foo=value". If a browser didn't return >>> it, some sites would break so the RFC had to define consistent behavior
Received on Monday, 6 July 2026 08:55:27 UTC