Delete Desktop Cookies

Is it possible to create a desktop app that will delete a specific list of Safari related cookies. Not All the cookies, just ones in a user specified list.

I know this can be done manually, but this customer needs to do this multiple times a day and wants a click-and-done solution

Right now he just needs to delete TWO specific ones out of a list of hundreds

I would think so

check in



many seem to be stored in individual files

actually for Safari they are stored in /cookies.binaryfile … which is of course encrypted

security :slight_smile:

fwiw my ~/Library/Cookies has 79 files
I’m sure some are for local storage but since they all seem to be encrypted its hard to know

I wonder if safari itself could be scripted to delete ones selectively ?

I have found some SWIFT code (for desktop) the references

var cookies:[HTTPCookie] = HTTPCookieStorage.shared.cookies!

but it comes back empty

Or something like this

A hunt of the app store for “Safari Cookie” reveals a few like this
Dunno if thats helpful or not

huh even found some python code that opens binary cookie files :slight_smile:

joy - more “stuff that makes you go huh” and wants to port this :slight_smile:

Ohhhhh !!!

this github page has an explanation of the binary cookie file format !

Saw that… but the problem is … deleting the cookie, and rebuilding the file without corrupting it… So for now, this project goes on the way back burner

yea shuffling binary data about is such fun :slight_smile: