Handle `Set-Cookie` attributes
paluh opened this issue · comments
Hyper's setCookie
is missing Set-Cookie
attributes setup.
I've implemented attribute handling on this branch.
Some notes:
-
I've added
Hyper.Cookie.setCookieHeaderValue
function (separate fromsetCookie
) because I want to reuse this serializer inhyperdrive
application context -
I've added this attributes setup to
Hyper.Session.saveSession
:SameSite=Lax;HttpOnly
, but probably this setup should be even more configurable -
I've added this attribute setup to
Hyper.Session.deleteSession
:MaxAge=0
-
In theory we should allow setup of multiple
Set-Cookie
headers, but I've read that fortunately it is not widely adopted, so we can stick probably with current behavior -
I'm really open to any suggestion to improve/change coding style of my chages
Should I provide PR with these changes?
Very nice! Let me look at this after work and get back to you. Thanks! 👍
I've merged this PR already.