0

Is there a programmatic way to clear all the cookies for a single site in chrome, including 3rd-party cookies that were put there by that site?

I know I can do this manually by clicking the padlock next to the URL, then going to Cookies and clicking remove for each one. Is there a way to do this automatically either through javascript or an extension?

0

You can delete cookies by using following javaScript code.

function deleteAllCookies() {
    var cookies = document.cookie.split(";");

    for (var i = 0; i < cookies.length; i++) {
        var cookie = cookies[i];
        var eqPos = cookie.indexOf("=");
        var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
        document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
    }
}

Or else you can also use following extension for clearing cookies from the browser.

Delete All Cookies From JavaScript

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.