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

Disable Cookie Handling #2067

Closed
brianjpetersen opened this issue Jul 6, 2017 · 6 comments
Closed

Disable Cookie Handling #2067

brianjpetersen opened this issue Jul 6, 2017 · 6 comments
Labels
documentation Improvements or additions to documentation outdated
Milestone

Comments

@brianjpetersen
Copy link

I'd like to disable cookie processing in the general case for the session but to allow them to be set for requests with redirects. For example, a request to httpbin.org/cookies/set?a=1 results in a redirect to httpbin.org/cookies with the appropriate Set-Cookie header. If I use a custom cookie jar (per Issue #957) that implements update_cookies as a no-op, when the redirect is followed, the cookies set in upstream requests aren't applied during subsequent redirects.

Aside from disabling redirects, setting cookies manually in the case of a redirect and following it manually, is there a way to deal with cookies more granularly than on a per-session basis?

@hubo1016
Copy link
Contributor

hubo1016 commented Jul 7, 2017

Maybe create a new session for every request?

@brianjpetersen
Copy link
Author

Thanks - that could work, although I'd lose the benefits of connection pooling, right?

@fafhrd91
Copy link
Member

fafhrd91 commented Jul 7, 2017

you can use custom connection object and pass connector_owner=False to Client session.

@brianjpetersen
Copy link
Author

Ahh, awesome. Thanks so much!

@asvetlov asvetlov reopened this Jul 11, 2017
@fafhrd91 fafhrd91 added this to the 2.3.0 milestone Jul 17, 2017
@fafhrd91 fafhrd91 added the documentation Improvements or additions to documentation label Jul 17, 2017
@asvetlov
Copy link
Member

Fixed by 0d9abc9

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation outdated
Projects
None yet
Development

No branches or pull requests

4 participants