Thursday, August 20, 2009

Safari - delete permanent cookies


Permanent cookies are a pain. I don't want to save any permanent cookies on my system.

Firefox allows me to automatically dump all permanent cookies when closing the browser:


Safari has no such option. Apple - this is a suggestion for you.

I have been tricking browsers into dumping cookies since 2001. For Netscape Navigator on Unix, it was easy. Simply symlink the cookies.txt file to /dev/null :) This forced every cookie to be treated as a session cookie.

For Safari, I had to write a wrapper script.

  1. Go to /Applications/Safari.app/Contents/MacOS
  2. Rename "Safari" to "Safari1"
  3. Create a shell script called "Safari" in the same directory as follows

#!/bin/sh
rm -f ~/Library/Cookies/Cookies.plist
${0}1 $*
rm -f ~/Library/Cookies/Cookies.plist

This will cause Safari to erase all cookies upon launching and exiting. Crude, but works.

No comments:

Post a Comment