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.

Cannot set multiple "Set-Cookie" response headers

See original GitHub issue

Prerequisites

Environment check

  • I’m using the latest msw version
  • I’m using Node.js version 14 or higher

Node.js version

v16.14.0

Reproduction repository

https://codesandbox.io/s/relaxed-vaughan-fuo4gq?file=/index.js

Reproduction steps

  1. Open the sandbox in a new window.
  2. Navigate to /. See the set-cookie response header in the Devtools.
  3. Navigate to /another. See the set-cookie response header in the Devtools. It’s missing a value.

Current behavior

Only the latest Set-Cookie value is being set on the mocked response.

Expected behavior

You can set multiple Set-Cookie response headers on a mocked response using the ctx.cookie transformer.s

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aleehedlcommented, Jul 4, 2022

Great! I got caught up with work stuff and then vacation stuff 😃

1reaction
aleehedlcommented, Jun 13, 2022

Hi @kettanaito. I think I could, possibly tomorrow 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

can no longer return multiple set-cookie headers from ... - GitHub
There should be a way to fix this server-side by using the headers.raw() method from node-fetch (which is what provides Headers on the...
Read more >
Are multiple Cookie headers allowed in an HTTP request?
The spec says the server should not fold multiple Set-Cookie header fields into one field, but it can add multiple Set-Cookie header fields...
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 >
RFC 6265 - HTTP State Management Mechanism
An origin server can include multiple Set-Cookie header fields in a single response. The presence of a Cookie or a Set-Cookie header field...
Read more >
setcookie - Manual - PHP
Note that the $_COOKIE variable not will hold multiple cookies with the same name. It is legitimate to set two cookies with the...
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