Support for creating a BaseClient that doesn't extract cookies. #2271
Unanswered
jonathanslenders
asked this question in
Ideas
Replies: 2 comments 3 replies
-
Adding A workaround for the moment would be something like... class DontPersistCookies(cookies.CookieJar):
def extract_cookies(self, request, response):
pass
client = httpx.Client(cookies=DontPersistCookies) (I've not tried it, but should be something like that?) |
Beta Was this translation helpful? Give feedback.
3 replies
-
Thank you @tomchristie ! That works. If we find some time, any of us will contribute a pull request. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be good to be able to create a client that doesn't extract cookies. That way, we can still take advantage of the connection pool, but don't have session information leak from one request to the next.
The implementation for this is probably fairly straightforward. I propose to accept a boolean
extract_cookies
inBaseClient
/Client
/AsyncClient
which defaults toTrue
and check for this where we callself.cookies.extract_cookies(response)
.Would you be willing to accept a patch for this?
Beta Was this translation helpful? Give feedback.
All reactions