Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:42 PST 2022; root:xnu-7195.141.26~1/RELEASE_ARM64_T8101
Binaries:
Node: 16.15.1
npm: 8.19.1
Yarn: N/A
pnpm: 7.6.0
Relevant packages:
next: 12.3.1-canary.1
eslint-config-next: 12.3.0
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
It is impossible to define multiple Set-Cookie headers, via next.config.js/headers. Next.js seems to only account for the last defined Set-Cookie header for a given path
Expected Behavior
Based on the rfc I would expect to be able to define multiple Set-Cookie headers and for the headers to not be combined into one header. (they re not combined atm, only the last header is used)
Link to reproduction
https://github.com/awareness481/next-config-cookies
To Reproduce
- See that next.config.js has two
Set-Cookie headers for each route
- Visit
http://localhost:3000/1 and observe that only one cookie is defined
- Visit
http://localhost:3000/2 and observe that only one cookie is defined
NEXT-582
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
It is impossible to define multiple
Set-Cookieheaders, via next.config.js/headers. Next.js seems to only account for the last definedSet-Cookieheader for a given pathExpected Behavior
Based on the rfc I would expect to be able to define multiple
Set-Cookieheaders and for the headers to not be combined into one header. (they re not combined atm, only the last header is used)Link to reproduction
https://github.com/awareness481/next-config-cookies
To Reproduce
Set-Cookieheaders for each routehttp://localhost:3000/1and observe that only one cookie is definedhttp://localhost:3000/2and observe that only one cookie is definedNEXT-582