Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create Safari cookies that expire after each session Web Browsers
In Mozilla and variants, and many other browsers, you can set Cookies to expire at the end of the session. This means that Cookies will be kept for your use, until you close your browser and they are then wiped out. I like that so that I have the benefits of Cookies but not the "long term tracking ability" that Cookies provide some less than above-board sites -- call me paranoid.

Well Safari has no preference to delete Cookies at any specified interval or when closing the browser. It IS easy enough in the preferences to delete them, but you still have to do it manually. However, Safari in its default configuration will store Cookies in the Cookies.plist file, which should be in the ~/Library -> Cookies folder. First remove all your cookies in Safari via the preferences, then do a Get Info on the Cookies.plist file and set it to Locked.

If you have successfully locked the file, in Panther at least, there will be a small locked padlock on the file icon. BINGO! Now Cookies will not be persisted to disk, only stored in memory during Safari's lifetime. You close Safari, Cookies go away!

Make sure that BEFORE you do this you go into Safari's preferences and remove all the cookies.
  • Currently 2.33 / 5
  You rated: 5 / 5 (12 votes cast)

Create Safari cookies that expire after each session | 5 comments | Create New Account
Click here to return to the 'Create Safari cookies that expire after each session' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create Safari cookies that expire after each session
Authored by: the_webmaestro on Oct 30, '03 12:22:16AM

Does this mean that if I have some sites I like, I can go there with the file unlocked, quit Safari, and then lock it afterwards? For example, I don't mind having know what my preferences are...



Father of Jeremy Logan Leeds

[ Reply to This | # ]
Create Safari cookies that expire after each session
Authored by: infinil on Oct 30, '03 02:22:21AM

I have tested this hint in Jaguar 10.2.8 (Safari 1.0 of course), and here is what i've found:

Within Safari I had set cookies to 'Always' (being the most generous of the options). I went to a site and cookies were set as usual on the normal cookies.plist file.

I quit Safari, and I then changed the permissions on the file to 'Read Only'. Opened a page in Safari, made a cookie, and quit again.
Safari then proceeded to *completely replace*, not overwrite, the cookies.plist file.

Not to be outdone, I then changed the cookies.plist file to 'No Access' all around.
Of course this had the effect that Safari was unable to read the cookies.plist file, and no cookies were read. Visited a site. Cookie was made, and was visible in the cookies preference pane. I quit Safari, and the cookies.plist file was overwritted yet again with the new cookies.

I have several cookies that I thought i'd rather like to keep. I hoped there would be a way to leave access to these, but disallow any more. The hint misled me into thinking this would be the case.

So just an FYI to those that still use Jaguar, i've yet to find a way to get cookies temporary in Safari.

- Dan

[ Reply to This | # ]
Create Safari cookies that expire after each session
Authored by: encro on Oct 30, '03 06:53:17AM

Reading your description above sounds like you didn't really follow the instructions...

Achieving the above doesn't mean changing the details in the "Ownership & Permissions" part of Get Info!

You change the status of the file in the "General" Section to Locked.

[ Reply to This | # ]
Another method...
Authored by: robg on Dec 12, '03 10:48:23AM
Submitted as a new hint, but really belongs here as a comment, from Anonymous:
I know there's a hint that suggests locking Cookies.plist. I instead created a folder called Cookies.plist in place of the file. That way you don't have to clear out all your cookies first. Also, I think this worked for me in 10.2, where the file locking solution only seems to work in 10.3.

[ Reply to This | # ]
Create Safari cookies that expire after each session
Authored by: Kevvin7 on Jan 14, '09 09:19:50AM
This hint no longer functions in 10.5. However, there is a slightly different version which does. See this hint for details.

[ Reply to This | # ]