How can I clear only two cookies using JavaScript?
I use the below code to set these cookies.
function setCookie(c_name, value, exdays)
{
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays==null) ? "" : ";expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
Under the Browsing history section, select Settings. In the Website Data Settings dialog box, select View files. Scroll through the list of cookies to find the one you want to delete. Select a cookie and press Delete on the keyboard.
Or, easier yet, copy and paste: chrome://settings/siteData into the address bar and hit Enter. While you can scroll through the multitude of stored cookies here, it has a simple search feature that allows you to find the specific offending site cookie and delete it.
Websites, third parties, and advertisers can store cookies and other data on your Mac. Remove stored cookies and data: Click Manage Website Data, select one or more websites, then click Remove or Remove All. Removing the data may reduce tracking, but may also log you out of websites or change website behavior.
1] Open Chrome and head to Settings. 2] Then, click on Site Settings > Storage. 3] Here, you'll see all the stored data for websites, including cache and cookies. 4] Select and clear the data for the website you want to.
A cookie is expired if the Expires parameter value is a date in the past. So just set the value to a date in the past:
function deleteCookie(c_name) {
document.cookie = encodeURIComponent(c_name) + "=deleted; expires=" + new Date(0).toUTCString();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With