Remove all cookies in JavaScript

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

document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });

I use this by pasting it directly in the browser console.