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

Multiple cookies with attributes #498

Closed
dufferzafar opened this issue Aug 3, 2016 · 1 comment
Closed

Multiple cookies with attributes #498

dufferzafar opened this issue Aug 3, 2016 · 1 comment

Comments

@dufferzafar
Copy link

How can I send two cookies each of which has some attributes.

The current syntax uses ; as a separator for multiple cookies, but that is a bit odd since cookies can have attributes which are separated by ;.

Using multiple Cookie headers doesn't work! :/

$ http http://httpbin.org/cookies 'Cookie:doo=dar; Path=/; Max-Age=0' 'Cookie:foo=bar; Path=/; Max-Age=0'

HTTP/1.1 200 OK
Content-Length: 40
Content-Type: application/json
Date: Wed, 03 Aug 2016 11:43:35 GMT

{
    "cookies": {
        "foo": "bar"
    }
}
@jkbrzt
Copy link
Member

jkbrzt commented Sep 5, 2017

Cookie attributes (like Path, Max-Age, HttpOnly, Secure, etc.) are sent by the server in the Set-Cookie header. But the Cookie header sent by the client doesn't included them; it only contains the name=value; name2=value2 pairs.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie

@jkbrzt jkbrzt closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants