I tried deleting Cookies in Safari manually, by deleting ~Library/Cookies
, ~/Library/Caches/com.apple.Safari
and ~/Library/Safari
.
The folders gets deleted, but the next time I launch Safari all cookies are restored. I am logged in all websites.
What did just happen? Why can't I delete cookies?
Best Answer
Yes, there is a way to effectively remove all cookies from Safari via the terminal as well, preventing the auto-restore phenomenon you described. I wrote a simple shell script some time ago to achieve this.
I tested this on macOS 10.12.3 and Safari 10.0.3 and it works.
Warning: The tests I did weren't as thorough, meaning: some of the files deleted by this script might not actually be necessary in order to achieve the removal of the cookies, you should trial-and-error your way around it to narrow it down if you like. I personally use the script 'as is', but in your personal situation that might mean you'll lose some data that you actually wanted to keep.
Copy this into a simple shell script and run it (be sure to also copy the 'killall' command):