Skip to content
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

setCookie resets other cookies #4550

Closed
jakajancar opened this issue Mar 31, 2020 · 3 comments
Closed

setCookie resets other cookies #4550

jakajancar opened this issue Mar 31, 2020 · 3 comments
Labels
bug Something isn't working correctly

Comments

@jakajancar
Copy link

jakajancar commented Mar 31, 2020

setCookie in std/http/cookie.ts will reset other cookies being set (replace the entire Set-Cookie header). I did not expect this.

Perhaps the easiest fix is to change from:

setCookie(res: Response, cookie: Cookie)

to

setCookies(res: Response, cookies: Cookie[])

Alternatively, perhaps res.headers.append() can be used in setCookie.

As it stands now, there is no way to set/modify two cookies in a single response with these utilities (e.g. session id and nonce for OAuth).

@ry ry added the bug Something isn't working correctly label Apr 1, 2020
@zhmushan
Copy link
Contributor

zhmushan commented Apr 1, 2020

@jakajancar This issue should be closed

@ry
Copy link
Member

ry commented Apr 1, 2020

Fixed in #4558

@ry ry closed this as completed Apr 1, 2020
@jakajancar
Copy link
Author

👍 thanks @zhmushan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants