You can use the private mode which erases cookies(I think) and your history upon closing the windows.
Answer from Matthew on Stack ExchangeYou can use the private mode which erases cookies(I think) and your history upon closing the windows.
Safari does not provide an option to auto-delete cookies on quit as other browsers do. So the idea is, to delete the cookies on shut down of Mac OS X using a shell script:
1. Create an empty Cookie file
- Open Safari
- Go to Preferences –> Security - > Show Cookies
- Delete all Cookies
- Quit Safari without loading any website in between
- Open Finder
- Go to „/Users/XXXXXX/Library/Cookies/“ (Replace XXXXX with your username)
- Copy „Cookies.plist“ to „CleanedCookies.plist“ in this folder*
Done! Now you should see two files in the folder „~/Library/Cookies/“: „Cookies.plist“ and „CleanedCookies.plist“!
2. Create autostart shell script
Open Terminal
Type: „cd /Library/StartupItems/“
Type: „sudo mkdir /DeleteCookies“ - > Enter your password
Type: „sudo pico“ (a shell text editor will open)
Paste this inside:*
#!/bin/sh . /etc/rc.common #StartService () #{ #} StopService () { cp -f /Users/XXXXX/Library/Cookies/CleanedCookies.plist /Users/XXXXX/Library/Cookies/Cookies.plist } RestartService () { StopService } RunService "$1"Change „XXXXX“ to your username (at two places!)
Press „Ctrl - X“ (it asks if it should save the document)
Press „Y“ (it asks for a file name)
Type „DeleteCookies“
Don’t close the Terminal! We will need it again.*
3. Create StartupParameters
In Terminal type: „sudo pico“
Paste this inside (with { and }):*
{quote} { Description = "DeleteCookies"; Provides = ("Deletes Safari cookies on shut down"); Uses = ("Disks"); } {quote}
Press „Ctrl - X“ (it asks if it should save the document)
Press „Y“ (it asks for a file name)
Type „StartupParameters.plist“
Now you may close the Terminal*
Now you should see two files in the folder „/Library/StartupItems/DeleteCookies/“: „DeleteCookies“ and „StartupParameters.plist“. Done!
4. Restart the system
- Restart your computer
- After reboot it will tell you that StartupItems do not have the right permissions
- Click on „Correct Permissions“ (2 times for the two created files)
- Restart your computer again.*
Now your Safari-Cookies should be deleted automatically each time when you shut down your PC.
Text source: apple community
How to auto-delete safari cookies on exit… - Apple Community
Clear cookies after 'quit safari' - Apple Community
Safari Extension to automatically delete cookies | MacRumors Forums
Delete the cookies of certain websites in Safari
Videos
In Safari for iOS, isthere a way to delete the cookies of only certain websites as opposed to clearing websites' cookies?
Is there a way to auto delete cookies on exit, but also to whitelist specific sites? I can’t find it anywhere in Safari settings and I’ve tried pretty much every decent browser there is too but can’t find such option. Even if I can’t whitelist, I just basically want private mode but with browsing history enabled.
Hey all, is there a way to set things up so that Safari automatically clears all the browser cookies on a set schedule (e.g., once weekly)? I regularly clear them myself, but it's annoying and I forget regularly.