5

I would like to delete all Safari cookies from terminal on Mac OS 10.7.2.

I tried to delete ~/Library/Cookie/Cookies.binarycookies (this is the only file in ~/Library/Cookie), but it didn't help.

Please advise.

2 Answers 2

5

You need to stop the cookied process. It's a user-specific process that manages cookies, and recreates the cookies database whenever it's deleted.

killall cookied

When you launch Safari the next time, cookied will not be able to recreate the Cookies.binarycookies file from memory and will start with an empty cookies database. The file that will be created then will effectively be empty (<1kb).

3
  • @Daniel Beck - are there other things that use cookied besides Safari?
    – cwd
    Sep 15, 2012 at 11:35
  • @cwd Probably anything using NSHTTPCookieStorage directly or indirectly. Just guessing here though.
    – Daniel Beck
    Sep 15, 2012 at 12:06
  • (for future readers, there does not seem to be a cookied process any longer in sierra, and deleting the Cookies.binarycookies file does seem to clear the cookies)
    – Dan Pritts
    Mar 7, 2017 at 15:34
0

Later versions of macOS have switched cookied with nsurlstoraged. Try:

rm -f ~/Library/Cookies/Cookies.binarycookies
pkill -U $(whoami) nsurlstoraged
1
  • Do you know if nsurlstoraged is still a thing, I don't see that running at all. Nov 6, 2023 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .