Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Delete history/cookies on closing Safari

I can't be certain, but I seem to remember there was a setting in Safari for deleting history and cookies upon closing the application automatically. I can't seem to find that setting. It appears to me that the only way to do that now is manually at the end of each session.


The problem I am having is that each time I open Safari I have all the previous tabs from previous use opening if I haven't manually deleted their history before closing Safari on the previous use.


I know this works in Firefox, which I use frequently. I am using Safari to record online streaming audio via Audio Hijack and I sometimes end up with multiple tabs open and am getting multiple audio sources. Audio Hijack has a timer that opens and closes Safari, but no control over the history that is created in Safari.



I would appreciate some help if anyone is so inclinded. Thank you.

iMac (27-inch Mid 2011), Mac OS X (10.7.4)

Posted on Jun 23, 2013 9:21 AM

Reply
Question marked as Best reply

Posted on Jun 23, 2013 9:48 AM

Safari 6.0.5 has a setting : Preferences - General - Safari opens with...

if that's set to ' a new window ' rather than 'all windows from last session' and you still have the issue, then check System Preferences - General - Close windows when quitting an application.

4 replies

Feb 17, 2014 9:22 AM in response to dnorth12

Old thread I know, but in regard to clearing cache and history on exit... that never has a good answer from what I have found. Since there is no way in the app or with any extension I can find to do this, the only method I see is lock down the files it writes to.


First, open Safari and clear the history, the quit.

Delete the contents of ~/Library/Caches/com.apple.Safari/Webpage Previews

In terminal remove write permisons (chmod a-w) on these files:

~/Library/Caches/com.apple.Safari/Webpage Previews

~/Library/Caches/com.apple.Safari/Caches*

~/Library/Safari/History.plist

Get info ~/Library/Safari/History.plist and check the box to make it locked.


Now Safari will show history while it's open, but can not write it out when you quit so it will not be saved, and the hundreds of megs of page preview caches will not be saved.


I haven't tested cookie blocking, but my assumption is you remove write and lock ~/Library/Cookies/com.apple.Safari.SafeBrowsing.binarycookies.

Delete history/cookies on closing Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.