New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response cookies are not being parsed correctly on browser. #1358
Comments
Would you like to send a PR to address this issue? It seems you have investigated it quite well. If not, can you please include an example to replicate this issue on Node.js only? It would be helpful to create a unit test. |
https://tools.ietf.org/html/rfc2109#section-4.2.2
RFC 2965 supersedes RFC 2109. It says: https://tools.ietf.org/html/rfc2965
In turn, RFC 6265 supersedes RFC 2109. However, it does not make the same statement in https://tools.ietf.org/html/rfc6265#section-4.1.1 . Instead, it says:
I believe the intention there is to state that a Regardless, a PR to make it work with browsers ignoring syntax that has been valid for literal decades would be welcome. |
🐛 Bug Report
In my case, the browser is not able to parse response cookies correctly. When I set multiple cookies, following line of 'Reply.header' function is combining the cookies into one header ('set-cookie') with comma separated cookies.
Chrome browser is not able to parse all cookies except the first one.
To Reproduce
I am using fastify-http-proxy and in beforeHandler, trying to set multiple cookies on reply like
Expected behavior
Not sure if it's a bug but it seems we should have multiple header entries for each cookie if we are calling Reply.header multiple times for setting the cookies.
More details are given in this link.
https://stackoverflow.com/questions/11533867/set-cookie-header-with-multiple-cookies
This may fix the issue.
Your Environment
cc @jsumners as he submitted the PR and made changes to this area.
#834
The text was updated successfully, but these errors were encountered: