Cookies are not set when port differs on the same domain
See original GitHub issueA request from localhost:3000 to localhost:8000 will ignore cookies. Though cookies are supposed to be port agnostics. Is this an implementation issue ?
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Are HTTP cookies port specific? - Stack Overflow
Theoretically, you can specify port number in the domain and the cookie will not be shared. In practice, this doesn't work with several...
Read more >Cookies, Ports and Subdomains | Node Security
This post will look at how browser cookies work when used on different subdomains and on different ports.
Read more >Cookies security problem: same domain but different ports
Hrm... I know sometimes we share cookies between http: and https:... but I thought in general we treated different port numbers as entirely...
Read more >Chrome does not include cookies in http request for the same ...
When I call app-two in Firefox, a cookie from app-one is included in the request to app-two, since the domain "my-local-box" is the...
Read more >Localhost - Two different Ports, one backend, but cookies are ...
You can't. Cookies are specific to the protocol+host+port combo (with special exceptions around subdomains), all controlled by the browser. One ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Cookies are not included in the fetch request by default: https://github.com/github/fetch#sending-cookies.
@BrendanFDMoore Your interpretation of the spec might be absolutely correct. However, our fetch polyfill does not implement anything regarding cookies, and never will. Handling of cookies is either up to the browser’s native implementation of
fetch(if there is one), or native implementation of XMLHttpRequest (which our polyfill uses). We can’t affect anything about how the browser stores or sends cookies.