delete-all-cookiesThis library exposes a function to clear all cookies that affect the currently loaded web page.
This is accomplished by iteratively removing all cookies for the current path, then the parent path, and so on, for the current domain, parent domain, and so on, as well as cookies without explicit path and domain specification.
Sample interactive usage:
Usage in browsers:
// in source: window.clearCookies = require('delete-all-cookies')(window) // ES 6: import deleteAllCookiesFactory from 'delete-all-cookies' window.clearCookies = deleteAllCookiesFactory(window) // then, in console: clearCookies()
<script src="https://unpkg.com/delete-all-cookies/index.js"></script> <script> deleteAllCookies(window) </script>
LicenseReleased under the MIT license.
The code is derived from several Stack Overflow answers to the question of clearing all cookies affecting the current web page.