You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a redirect to a different domain, a cookie set using Set-Cookie without a Domain should become a cookie set only for the redirected domain, but HTTPie saves it in the session of the original domain.
Steps to reproduce:
Save app.py & app2.py (Need Python 3+, Flask 1.1.0):
Run http --session=foo -v -F http://localhost:5000/set
The cookie will be saved in the session for localhost:5000, and not for localhost:5001. Separete requests to http://localhost:5001 will not send the cookie.
When using a session file instead (--session=./session.json), the cookie will be saved in the single session file and will be sent on subsequent requests but without taking the cookie domain into account which can be problematic for some sites and use cases.
But the following request to domain A fails to include that new cookie.
If I examine the headers in the accompanying session file, I see the domain is wrongly explicitly set for this cookie!
After a redirect to a different domain, a cookie set using
Set-Cookie
without aDomain
should become a cookie set only for the redirected domain, but HTTPie saves it in the session of the original domain.Steps to reproduce:
Save
app.py
&app2.py
(Need Python 3+, Flask 1.1.0):app.py
:app2.py
:Run both apps in two seperate terminals:
Run
http --session=foo -v -F http://localhost:5000/set
The cookie will be saved in the session for
localhost:5000
, and not forlocalhost:5001
. Separete requests tohttp://localhost:5001
will not send the cookie.When using a session file instead (
--session=./session.json
), the cookie will be saved in the single session file and will be sent on subsequent requests but without taking the cookie domain into account which can be problematic for some sites and use cases.See https://tools.ietf.org/html/rfc6265
The text was updated successfully, but these errors were encountered: