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.

Only the first Set-Cookie in response header is handled

See original GitHub issue

Current behavior:

I have a login request in my app setting multiple cookies with Set-Cookie in response header, and when using cypress, I can see that there is only one which has been set.

Set-Cookie: remember_token=5b56f2475e4fd43e29af88f5|d306269868c30bd9c05dff29c40f80a316ba9f3b89a2411eec828acd7727ee20f33343855a4bf9d6057566d3caeffc450d609e92959bcd13ed51dae61083c924; Expires=Fri, 26-Jul-2019 11:56:48 GMT; Path=/ Set-Cookie: session=7214d946e7d432a2_5b5990f8.Z070v-xcY5DkeZtO9hpIqMUtZiM; Domain=.***.com; HttpOnly; Path=/

And getCookies will tell us: [{domain: "localhost", expiry: 1564142368.196979, httpOnly: false, name: "remember_token", path: "/", secure: false, value: "5b56f2475e4fd43e29af88f5|e6fd9605b6972dfc04c4d72a3f2053aa9629973154580f181f048cc123eb203d35f364d1e0d67130a868f2e10adefe9fe69ed845e9cd48f81a1fec129834b370"}]

Desired behavior:

Handle multiple Set-Cookie in response header

Steps to reproduce:

Having a response setting multiple cookies, and check whith cypress the cookies after that request

Versions

OS: Debian 9.4 Cypress: 3.0.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jennifer-shehanecommented, Dec 4, 2018

@Far3t We did include some cookie fixes into Cypress recently.

@rbpaul2, @d0n0tdisturb, @aepplerplangrid can any of you confirm this is now working in Cypress version >3.1.2?

0reactions
jennifer-shehanecommented, Apr 24, 2019

Closing as resolved. Please comment if you are still having this issue and we will consider reopening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome only sets the first cookie from the 'Set-Cookie' header
I have a dead simple http nodejs server:
Read more >
Set-Cookie - HTTP - MDN Web Docs
The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so that the user agent...
Read more >
setcookie - Manual - PHP
setcookie () defines a cookie to be sent along with the rest of the HTTP headers. Like other headers, cookies must be sent...
Read more >
Set-Cookie Headers getting stripped in ASP.NET HttpHandlers
Response.ClearHeaders() was called before headers are added · Response. · If there's no physical file: web. · It only occurs if there are...
Read more >
7 Keys to the Mystery of a Missing Cookie - Medium
Check out the OPTIONS response header ACCESS-CONTROL-ALLOW-CREDENTIAL whether it is set to true . If the server doesn't allow credentials being ...
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