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

Add ability to clear cookies from a CookieStore #1437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pfernie
Copy link
Contributor

@pfernie pfernie commented Jan 12, 2022

Addresses #613 for a simple "batteries included" quality-of-life improvement.

Adds method clear(&self) to trait cookies::CookieStore, allowing
users to clear a store's contents.

Adds method clear_cookies(&self) to Client under feature cookies.

Alternatively, instead of adding this to the cookies::CookieStore trait and expanding the Client API, the cookies::Jar impl could be extended with the requested method directly. However, this does not seem to be as "batteries included" for users that simply want to utilize the default Jar via ClientBuilder::cookie_store(true).

@seanmonstar seanmonstar added the B-breaking-change Blocked: breaking change. label Nov 15, 2022
@Okabe-Rintarou-0
Copy link

Is this issue still open? I also need to clear cookies

Adds method `clear(&self)` to trait `cookies::CookieStore`, allowing
users to clear a store's contents.

Adds method `clear_cookies(&self)` to `Client` under feature `cookies`.
@pfernie
Copy link
Contributor Author

pfernie commented Apr 30, 2024

The original change here is breaking, as it has been labelled (and I did not keep on top of for inclusion in last breaking release...). I've rebased the existing PR for current master, but the change will not be eligible for merging until the next breaking release of reqwest.

In the meantime, you can use something like reqwest_cookie_store which gives you more direct access to the underlying store, which does expose a clear() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-breaking-change Blocked: breaking change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants