std/http/setCookie doesn't work?
It seems to only support single cookies:
Also, it assumes the
Headers
object is a container for response headers. For request headers it the right header would be cookie:
, not set-cookie:
.4 Replies
That is indeed weird behavior, however you can pass multiple cookies using the Headers constructor: https://deno.land/std@0.211.0/http/cookie.ts?s=getSetCookies#Examples
(as a workaround)
Right, but then I don't need
std/http
.
The lack of a cookie jar for fetch()
is pretty sad. I would put that pretty high on my wishlist…I'd consider this a bug. Can you file an issue for that on the std repo? cc @iuioiua
Ah, the bug is in how
Deno.inspect()
reports the content of the Headers
object, not in the std/http library!![No description](https://cdn.answeroverflow.com/1192740365569101947/Screenshot_2024-01-05_at_17.02.45.png)