Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jedimasterkyle

macrumors 6502a
Original poster
Sep 27, 2014
580
881
Idaho
So, as the title says, I just realized that Safari on MacOS Sonoma has been saving my search history for over a week while in private browsing. Every time I close Safari, I make sure the app is CLOSED. But when I reopen it in private browsing mode, voila...a weeks worth of search history.

Not sure if anyone else has had this issue but yeah...this statement is mis-leading or downright false.
Screenshot 2024-02-13 at 2.22.07 PM.png
 

ab22

macrumors regular
Nov 14, 2020
173
104
It works as expected here. I'd take some screenshots etc & report it to Apple.
 

IngoX

macrumors regular
Jan 4, 2022
140
98
Sweden
Works as expected here on 14.3.1. Of course, when you open a private browsing window you can see the history from non-private browsing, is this the case?

Also, if you have activated profiles in Safari you probably have one profile called Personal. Can you mistakenly have chosen a new "Personal" window instead of a "Private" window during browsing-sessions earlier in the week?
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,239
13,311
If you want to wipe cookies (and more) when using Safari, I would highly recommend a 3rd party app/utility called [simply] "Cookie":

It can remove:
tracking cookies
non-favorites (favorites are specific cookies you wish to save between Safari sessions)
cache
history
favicons
webpage previews
form values
downloads
website preferences


It has a full-featured trial mode, also.

Again, if you want CONTROL over how Safari's history/cookies works, THIS is the app to use.
 

bzgnyc2

macrumors 6502
Dec 8, 2023
383
408
So, as the title says, I just realized that Safari on MacOS Sonoma has been saving my search history for over a week while in private browsing. Every time I close Safari, I make sure the app is CLOSED. But when I reopen it in private browsing mode, voila...a weeks worth of search history.

Not sure if anyone else has had this issue but yeah...this statement is mis-leading or downright false.
View attachment 2349053

I wouldn't really count on private browsing in Safari. Try this as the command prompt in Terminal:

sqlite3 ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.db "SELECT url from bookmarks;"


Haven't tried on Sonoma but on older versions of MacOS/Safari, you'll see the URL of links you opened in a private window from far more than a week prior.

Also in case you're wondering that file/command has nothing to do with your bookmarks despite the reference to such.
 

bogdanw

macrumors 603
Mar 10, 2009
6,117
3,028
Delete Safari History
rm ~/Library/Safari/History.*

Delete Safari Cookies
rm ~/Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies

Delete SafariTabs
rm ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.*
rm ~/Library/Containers/com.apple.Safari/Data/Library/Safari/CloudTabs.*

Delete Safari Caches
rm -r ~/Library/Containers/com.apple.Safari/Data/Library/Caches

All together in an AppleScript that can be saved as an app:
AppleScript:
try
    do shell script "rm ~/Library/Safari/History.*"
end try
try
    do shell script "rm ~/Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies"
end try
try
    do shell script "rm ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.*"
end try
try
    do shell script "rm ~/Library/Containers/com.apple.Safari/Data/Library/Safari/CloudTabs.*"
end try
try
    do shell script "rm -r ~/Library/Containers/com.apple.Safari/Data/Library/Caches"
end try
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,239
13,311
The problem with running a script or command like the ones posted by bogdan above is that doing so will remove ALL cookies -- even some that you might rather retain for frequently-used web sites.

Using "Cookie" (as I mentioned in reply 4 above) allows you to select/deselect those specific cookies you WANT to keep, and REMOVE all others.

For example, if you remove all cookies, you'll have to re-log into this site.
But with Cookie, I have macrumors.com on my "saved" cookie list, so my settings are retained from visit to visit.
While, at the same time, cookies and all other data from sites I may visit randomly are destroyed when I close my browser (Safari, but Cookie works with multiple browsers, as well).

It's the best "cookie-handling" app I've seen.

Actually, it seems to me that such a feature (select cookies to be retained while others are destroyed when closing) ought to be a feature of ALL browsers...
 
  • Like
Reactions: bzgnyc2
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.