Home Remove all cookies in JavaScript
Post
Cancel

Remove all cookies in JavaScript

The following snippet allows you to remove all cookies in JavaScript (client-side).

1
document.cookie.split(';').forEach((c) => {document.cookie = c.replace(/^ +/, '').replace(/=.*/, `=;expires=${(new Date()).toUTCString()};path=/`)});

You can use it by pasting it directly on the browser console.

This post is licensed under CC BY 4.0 by the author.

Rails authentication with Devise

Simple PayPal checkout in Ruby on Rails using Orders API v2