question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cookies are not set when port differs on the same domain

See original GitHub issue

A 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:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dgrahamcommented, Sep 9, 2015

Cookies are not included in the fetch request by default: https://github.com/github/fetch#sending-cookies.

0reactions
mislavcommented, Oct 15, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found