Clear cookies/local storage for a specific site easily


#1

At the moment it is difficult to impossible to clear one’s cookies and local storage for a specific site. It’s possible and not too difficult to do so for all sites in the settings, back for a chosen time period, but doing so for one site is I think not possible and if possible certainly hard enough to discover that I have not discovered it.

For extra credit, a way to prevent certain sites from setting cookies at all, or to clear them automatically after a page has loaded, would be pretty cool.


Clear cookies and cache for only one site
#2

cc: @serg for thoughts


#3

Hi @sil. You can clear per site storage in Settings->Site Settings->Storage. Just click on the website there.

Thanks.


#4

I use the Sqlite command shell to clean problem cookies. Close all Brave windows first.

Command line: (change the directory to match your system)

sqlite3 -echo -init /home/stan/bin/brave-cclean-sql

The command file, this shows the count of cookies to be deleted and then deletes them. Just put your desired host names in place of mine in both sections and run it with Brave closed.

.print Running script
.output stdout
.open /home/stan/.config/brave/Cookies
select count(*) from cookies where host_key = "static.azcentral.com";
select count(*) from cookies where host_key = "www.azcentral.com";
select count(*) from cookies where host_key = ".azcentral.com";
.print .
delete from cookies where host_key = "static.azcentral.com";
delete from cookies where host_key = "www.azcentral.com";
delete from cookies where host_key = ".azcentral.com";
.print Script finished
.print .
.print .

Enter .quit to exit Sqlite.


#5

Ooh, you bally hero, what are you? nice one! I did in fact not know this. I was a bit confused by the existence of Settings > Site Settings > All Sites, which listed some websites but not the one I wanted to clear; I don’t know how some sites get into that list and others don’t.


#6

You are welcome! :slight_smile:


#7