[Feature] Cookie Removal Api
See original GitHub issueIt would be nice to clear the cookie using its name or domain etc. It has a lot of uses like logging out and logging in to certain websites.
Currently, we have only one way to clear the whole cookie. Yes, there are workaround like getting all cookies filtering them, and writing the cookies back using add cookies. So I am making this proposal to add cookie removal API which clears based on name or URL etc.
await context.clearCookies(cookie => cookie.name.startsWith("HELLO"))
would remove all cookies which has name that starts with HELLO
?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:5
Top Results From Across the Web
cookies.remove() - Mozilla - MDN Web Docs
The remove() method of the cookies API deletes a cookie, given its name and URL. The call succeeds only if you include the...
Read more >Remove Cookies by clicking on button - Web Extension API
The remove() method of the cookies API deletes a cookie, given its name and URL. This means you also need to specify the...
Read more >Cookies API - The Chromium Projects
Overview. The proposed API allows Chrome extensions to access the browser's cookies, without having to send HTTP requests to obtain those cookies. Use...
Read more >cookie banner API - HubSpot Developers
You can remove the cookie by calling the function again and including the {track: true} argument: _hsq.push(['doNotTrack', {track: true}]);.
Read more >chrome.cookies - Chrome Developers
The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to "chrome.cookies.remove", "cause" will be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s a helper script for clearing cookie by name in Playwright.
@manochernazari
There is an workaround. Firstly, store the cookies in variable, clear the cookies and insert the cookies by filtering out the one which you don’t need.