Closed SchrodingerZhu closed 5 years ago
This makes sense. What API would you suggest? The cookie headers are special cases in HTTP requests because there are different rules for combining multiple cookie headers, so I've never been sure if this should live in Raxx core or the cookie project somehow
Raxx.set_header
will keep me from inserting multiple cookies. But as I have mentioned before, simply use Map.update!
to append new cookie structure like {"set-cookie", "foo=bar"}
in the response.header
seems working smoothly. Raxx
seems to have the ability to handle multiple {"set-cookie", _}
items correctly. Maybe add a special conflict check for set-cookie
header or just a new method to handle cookies?
A new method to handle cookies makes sense, however everything relating to cookies I have extracted to the cookie project. https://hex.pm/packages/cookie
I think I will close this issue, in favour of improving the :cookie
project.
This issue should not be closed, because the cookie package does not handle set-cookie
header at all. Currently it's not possible to have multiple set-cookie
headers in Raxx and the cookie library cannot change that because it's a Raxx limitation.
I have to use
Map.update!
to set multiple cookies now. I suggest we should allow user to insert multipleset-cookie
items in header.