Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-Cookie domain attribute actually needs leading dot to work #32050

Open
djc opened this issue Feb 1, 2024 · 2 comments
Open

Set-Cookie domain attribute actually needs leading dot to work #32050

djc opened this issue Feb 1, 2024 · 2 comments
Labels
Content:HTTP HTTP docs help wanted If you know something about this topic, we would love your help!

Comments

@djc
Copy link
Contributor

djc commented Feb 1, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie

What specific section or headline is this issue about?

Domain attribute

What information was incorrect, unhelpful, or incomplete?

Contrary to earlier specifications, leading dots in domain names (.example.com) are ignored.

Despite the specification in RFC 6265, in our testing, it appears that current browsers (Chrome, Firefox, Safari) actually need the leading dot to make cookies from subdomains work in parent domains.

What did you expect to see?

Cookies should be accessible across domains sharing a common suffix even when the Domain attribute does not specify a leading dot (as in Domain = example.com).

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@djc djc added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 1, 2024
@github-actions github-actions bot added the Content:HTTP HTTP docs label Feb 1, 2024
@juangir
Copy link

juangir commented Feb 6, 2024

Hi,
I've seen also this issue with most modern Browsers.
But it seems that browsers have a lot stuff not being compliant with RFC 6265. Here Ivan Nikulin
covers a lot of problems
.
I think in the MDN documentation should not state (as a fact) that cookies behave in this way. Also can be seen here in which states "if you set Domain=mozilla.org, cookies are available on mozilla.org and its subdomains like developer.mozilla.org." which in most cases is not true, and should be set to domain=.mozilla.org to be available to subdomains.

@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jun 20, 2024
@dpchamps
Copy link

@djc do you have a repro of what you're observing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTTP HTTP docs help wanted If you know something about this topic, we would love your help!
4 participants