-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Set-Cookie Headers behavior #294
Comments
+1 for this. We have a project called HatTip that aims to be a universal JavaScript HTTP server library/framework. This is one of the two failing cases in Bun integration (the other is related to streaming). |
+1 as well. We need Deno's implementation of Header. I know it technically goes against the spec but until there are any implementors of getSetCookie we're out of luck. @cyco130 I'm very interested in your project but I like the idea of having native support to build things around the Zig-based Bun.serve. |
You can try npm cookie that work okay. https://www.npmjs.com/package/cookie
|
@Lightnet |
@ksmithut My thoughts exactly, couldn't have said it better! |
There seems to be two reasonable solutions to this issue.
interface Headers {
getAll(name: "Set-Cookie"): string[];
}
interface Headers {
setSetCookie(): string[];
} Personally, I think |
Both |
The behavior of setting cookies with the
Headers
type does not allow you to set multiple cookies. See this issue for undici (node's implementation of fetch) for what they might be doing about it. Deno seems to behave the way that will work with browsers (setting a new header entry for each set-cookie) and it seems like that's the only header that needs to behave that way, which is why it seems thatHeaders.prototype.getSetCookie
is a proposal to solve for this issue.The text was updated successfully, but these errors were encountered: