Disclaimer: We sustain our work & review products through paid collaborations.
When Safari Database Cookies Keep Coming Back

When Safari Database Cookies Keep Coming Back


MacOS Privacy

Have you ever wondered why Safari retains data from websites even if you instruct it to remove all website data? If yes, you are not alone with your question. If you have ever removed cookies manually from your preferred web browsers, you must have noticed that sometimes it may take a few “Remove All” clicks for the cookies to disappear from your Mac, and yet still some ‘stubborn’ database files remain. In this article we will show you how to erase those stubborn files that keep coming back.

Clearing cookies with Mac optimization apps

Privacy-conscious Mac users regularly clean their web browsers of cookies using third party Mac optimization software such as CleanMyMac or OnyX. As you may already know, websites often store cookies and other data locally on your own machine that contains information you have at some point provided: name, email address, preferences, and the like. Cookies are helpful for identifying you on a return visit to those sites.

Mac optimization apps are very helpful for doing the cookie cleaning (alongside any browsing history) but they fail to wipe away all the data left behind on your computer, such as database files from websites stored on your Mac.

What are those database files?

safecart.com Databases

As Apple explains to developers looking to launch websites, there are three independent components of the HTML5 client-side storage in Safari: the offline application cache, key-value storage and JavaScript database storage. The last option reduces server load by replacing server-side programs with client-side scripts, and this enables them to even store large amounts of structured data locally using an SQL-compatible JavaScript database. This allows website developers to keep user-generated and user-consumed data on the user’s computer and transfer the processing load from the server to the user’s CPU. It also allows the developer to limit the data set accessible to SQL over the internet.

In a support document published in the spring of 2017, Apple explains:

"You can use some websites to create and edit documents that are saved on your computer – for example, a travel log about your latest vacation. When you save the document, the website uses space on your computer to store your document as a database."

How to remove database files from your computer

Interestingly, neither Firefox nor Chrome lists the database files when you search for them in Preferences and “cookies”. Apple’s strategy, on the other hand, is to inform users about the existence of such databases. These can be checked for yourself to find out if any website has stored data on your Mac by launching Safari and selecting Preferences, then the Privacy tab. Here, you’ll find all the cookies that websites have stored on your computer. Either go through them one by one or click “Remove all” to delete them. What will remain are only the websites with the “Databases” information below them.

To erase these files, follow the steps below.

40% discount with CleanMyMac
CleanMyMac logo
Switch your current Mac optimizer for CleanMyMac and the company will offer you a tasty 40% discount.
Save 40% on CleanMyMac

How to remove database files

1

Launch Finder.

2

Press Command-Shift-G (or “Go to Folder” from the “Go” menu).

3

Type this command: ~/Library/Safari/Databases

Although you have now successfully removed the database files, keep in mind that this won’t stop them from coming back if you are visiting sites that use JavaScript databases. Since Mac optimization apps cannot remove them, we recommend checking back from time to time and repeating the above steps. This is how you can achieve a much cleaner Mac and protect your privacy at the same time.


Best Mac optimization software of 2025

Editor's choice

CleanMyMac

Editor's rating:
User-friendly dashboard
Effective scanning and cleaning options
Various maintenance tools
Built-in malware remover
All-around protection

MacKeeper

Editor's rating:
Personalized remote assistance
Unique optimization tools
Anti-theft tracking
Built-in antivirus
Beginners

MacBooster

Editor's rating:
Fast scanning
User-friendly UI
Virus and malware scan
Great cleaning features
Businesses

CCleaner for Mac

Editor's rating:
Fast scans and cleaning
Full customization
Extensive free version
Affordable

Discussions

Share your thoughts, ask questions, and connect with other users. Your feedback helps our community make better decisions.

©2012-2025 Best Reviews, a clovio brand – All rights reserved