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

jlgolson

Contributing Editor
Original poster
Jun 2, 2011
383
8
Durango, CO
Does anyone else have problems with Safari on macOS just randomly logging you out from everything?

I can't tell if it's just wiping out cookies or what but it keeps happening. It happened under Ventura and now Sonoma. Super annoying.

Just, one morning I'll sit down and have to log back into Google, Facebook, YouTube, Amazon, everything. It looks like the cookies are still there, but it acts like they're all gone. Anyone else experience this or have a weird fix?

Resetting Safari doesn't seem to help, but it's intermittent and has been going on for years.
 
  • Like
Reactions: MBAir2010

Nermal

Moderator
Staff member
Dec 7, 2002
20,645
4,044
New Zealand
I can't help with fixing the actual problem, but I at least wanted to let you know that it's not normal. I've seen a handful of sites that lose their logins, but never at the same time, and the same issue occurs under Firefox so I'm pretty sure that it's the individual sites at fault. In twenty years of using Safari I don't think I've ever seen it lose all logins at once.

Are you using any of the "cloudy" features or is everything local?
 

BotchQue

macrumors 6502
Dec 22, 2019
422
577
I've been having that issue, but only in the last few months or so, and only on my iOS iPad (which I only use when my laptop runs out of juice), have to re-log into all my sites.
 

jlgolson

Contributing Editor
Original poster
Jun 2, 2011
383
8
Durango, CO
It happened again today. Had to log into Google, LinkedIn, Facebook, Amazon, Twitter, everywhere. I don't wanna reinstall everythinggggggggggg but that's probably my only fix since there's no easy way to wipe Safari away and reinstall it, right?
 

bogdanw

macrumors 603
Mar 10, 2009
5,692
2,725
Safari now stores cookies in ~/Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies
When cookies are deleted from Safari’s menu, the database Cookies.binarycookies is not deleted, just emptied. Just as other macOS databases (TCC for example), Cookies.binarycookies can probably be corrupted, especially after macOS security updates.
Closing Safari, deleting Cookies.binarycookies and letting the latest version of Safari recreate the database might help.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,692
4,573
New Jersey Pine Barrens
Resetting Safari doesn't seem to help, but it's intermittent and has been going on for years.

I'm still on Monterey, so I haven't seen the behavior of getting logged out continuously. However, a few years ago, Apple made a change to Safari where all cookies and localStorage data gets wiped if you don't visit a site for 7 days. AFAIK, other browsers don't do this (or have a much longer limit). I find this annoying with sites like the electric company that I only visit once a month to pay my bill, since it forces me to login everytime, even when I check the "remember me" box on the site.

"Now ITP has aligned the remaining script-writable storage forms with the existing client-side cookie restriction, deleting all of a website’s script-writable storage after seven days of Safari use without user interaction on the site. These are the script-writable storage forms affected (excluding some legacy website data types):

Indexed DB
LocalStorage
Media keys
SessionStorage
Service Worker registrations and cache"


 

interstella

macrumors 6502
Sep 29, 2013
284
166
Suffolk, England
This happened to me last night on my M2 MBA running Sonoma. I opened Safari and found I was logged out of almost every website except Facebook. Reddit, online newspapers, MacRumors, YouTube, Google, Amazon, various website I use for hobbies etc. I was logged out of the lot. To my knowledge I've done nothing to cause this to happen. It was fine at 5pm Friday. When I next used it at 10pm I had to log back in to my sites. My M2 Pro Mac mini is, so far, unaffected.
 

jlgolson

Contributing Editor
Original poster
Jun 2, 2011
383
8
Durango, CO
Safari now stores cookies in ~/Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies
When cookies are deleted from Safari’s menu, the database Cookies.binarycookies is not deleted, just emptied. Just as other macOS databases (TCC for example), Cookies.binarycookies can probably be corrupted, especially after macOS security updates.
Closing Safari, deleting Cookies.binarycookies and letting the latest version of Safari recreate the database might help.
So in Sonoma 14.1.2 (for me at least), I don't even have a com.apple.Safari container.

I do have ~/Cookies/Cookies.binarycookies, however — with a modification date of a minute ago. Maybe deleting that will help...
 

Attachments

  • Screenshot 2023-12-03 at 6.08.21 PM.png
    Screenshot 2023-12-03 at 6.08.21 PM.png
    72.4 KB · Views: 49

bogdanw

macrumors 603
Mar 10, 2009
5,692
2,725
So in Sonoma 14.1.2 (for me at least), I don't even have a com.apple.Safari container.

I do have ~/Cookies/Cookies.binarycookies, however — with a modification date of a minute ago. Maybe deleting that will help...
I assume it’s ~/Library/Cookies/Cookies.binarycookies and yes, closing Safari and deleting that file might help.

The folder ~/Library/Cookies is empty in a system that had a fresh install of Sonoma 14.1.2. It’s probably still used on systems that have been upgraded from a previous macOS version or restored from TimeMachine backups.
 
  • Like
Reactions: jlgolson
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.