Skip to content

Deprecate per-request cookies - #1574

Merged
lovelydinosaur merged 6 commits into
masterfrom
deprecate-per-request-cookies
Apr 19, 2021
Merged

Deprecate per-request cookies#1574
lovelydinosaur merged 6 commits into
masterfrom
deprecate-per-request-cookies

Conversation

@lovelydinosaur

Copy link
Copy Markdown
Contributor

Closes #1404

Documentation here is as follows...


Cookies

If using a client instance, then cookies should always be set on the client rather than on a per-request basis.

This usage is supported...

client=httpx.Client(cookies=...)
client.post(...)

This usage is deprecated...

client=httpx.Client()
client.post(..., cookies=...)

We prefer enforcing a stricter API here because it provides clearer expectations around cookie persistence, particularly when redirects occur.

@lovelydinosaurlovelydinosaur added this to the v0.18 milestone Apr 14, 2021
@lovelydinosaurlovelydinosaur added the user-experience Ensuring that users have a good experience using the library label Apr 14, 2021
Comment threadhttpx/_client.py Outdated
Comment threaddocs/compatibility.md Outdated
@lovelydinosaur
lovelydinosaur merged commit 6a99f6f into masterApr 19, 2021
@lovelydinosaur
lovelydinosaur deleted the deprecate-per-request-cookies branch April 19, 2021 10:18
@lovelydinosaurlovelydinosaur mentioned this pull request Apr 21, 2021
@rafalkrupinski

rafalkrupinski commented Jan 30, 2024

Copy link
Copy Markdown

I would really hate loosing per-request cookies. Cookies are just a header, why the Cookies facility class should be disabled when doing redirects?

Wouldn't it be reasonable to expect request cookies to follow the redirects, either by default or with a flag?
I'll follow up in #1404

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

user-experienceEnsuring that users have a good experience using the library

Development

Successfully merging this pull request may close these issues.

Cookies are not sent after redirect (even on same origin)

4 participants

@lovelydinosaur@rafalkrupinski@StephenBrown2@florimondmanca