Bug (Maybe) cookies are duplicated on subsequent redirects
See original GitHub issueI am not sure if this is a bug yet, trying to reproduce and write some tests, but cannot due to #227
But figured I’ll open an issue, just in case, maybe you can spot the error, if there is one.
Here is a sanitized request flow:
GET /url1 HTTP/1.1
Cookie: cookiename=111111;
Host: example.com
HTTP/1.1 302 Found
Location: https://example.com/url2
GET /url2 HTTP/1.1
Cookie: cookiename=111111; cookiename=111111;
Host: example.com
HTTP/1.1 302 Found
Location: /url3
Set-Cookie: cookiename=222222; Domain=example.com; Expires=Thu, 10-Nov-2039 23:46:26 GMT; Path=/
GET /url3 HTTP/1.1
Cookie: cookiename=111111; cookiename=111111; cookiename=222222;
Host: example.com
Notice that with each request the cookies get appended and they have duplicate names.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Chrome is incorrectly storing and sending duplicate cookies ...
Chrome seems to send multiple cookie data to server if duplicated entries exist. Which one is sent first to server is perhaps unpedictable,...
Read more >Duplicated Set-Cookie header handling · Issue #954 - GitHub
Client handle its and sends back the last value seen on subsequent redirects (there are two). Cookie: app_ei=ksoes2ehf18tbh8nct6lvamuu4; $Path=" ...
Read more >145492 - Sending out duplicate cookies for domains with and ...
BACKGROUND: If a set-cookie header received from a site contains a domain attribute and the domain does not start with a dot, that...
Read more >219650 – Cookies set with SameSite=Lax are not sent during ...
In my bug SameSite=lax cookie was set during redirect dance. > > 1. navigate https://siteA.com/x (in our case it was > https://accounts.google.
Read more >Duplicate, Google chose different canonical than user
Perhaps Google was right, and you should just take the URL they chose and use that as the canonical URL. c) implement a...
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 FreeTop 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
Top GitHub Comments
Hi, sorry about the trouble. By mistake I was sending the cookie header by using the axios headers option. Your plugin also adds the same cookie from the cookie jar. That is why it was duplicated.
You may close this issue.
Thanks for the quick response. Let me write a test (sample code) for this.