10.5: Create session-only cookies in Safari in 10.5.6

Jan 14, '09 07:30:00AM

Contributed by: Kevvin7

For the paranoid, the pornsurfer, as well as anyone with a not-undue concern about online tracking, it is useful to be able to automatically delete all cookies when quitting one's browser.

For most of the history of Safari, although the browser did not provide a way of erasing all cookies at shutdown, the facility could be emulated by setting one's ~/Library » Cookies » cookies.plist file to "read only" (see this hint). Since cookies are stored in memory until the browser shuts down, the result was a perfectly normal browser session with no cookies carried to the next session.

This ability went away with 10.5, as a read-only cookie file caused random issues at most sites requiring a login cookie. There was no option but to reset the cookie.plist file to read/write, and delete them by hand every now and then.

The problem has been resolved in 10.5.6, but the technique for achieving it is slightly different -- you now must set the containing folder to read-only, not the file. Read on for a detailed walkthrough, if you need it...

The complete recipe is:

  1. Launch Safari, then open its Preferences and select the Security tab.
  2. Click the Show Cookies button, then click Remove All. (Alternatively, keep any cookies you really want), then click Done.
  3. Quit Safari.
  4. In the Finder, navigate to ~/Library.
  5. Select the folder Cookies and press Command-I to open the Get Info window.
  6. Under Sharing and Permissions, authenticate by clicking the padlock icon.
  7. Set the privilege next to your username to Read Only, and make sure it is No Access for all other users.
  8. Close the Get Info window.
Congratulations, you now have session-only cookies once again.

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090113161231215