Apple Event: May 7th at 7 am PT

Automatic cookie cleaning in Safari 17 with opened console

Hello Apple community! I'm reaching out today with a question about Safari 17 on Mac OS Sonoma. I've noticed a peculiar behavior that I haven't encountered in previous Safari versions, and I'm wondering if anyone else is experiencing the same issue.


Whenever I open the console in Safari 17 to debug web applications or check for any errors, I've noticed that all cookies seem to be automatically deleted. This behavior didn't occur with earlier Safari versions, and it's become a bit of a hassle for me.


I rely on cookies to help with various aspects of my work, and this automatic deletion is causing some disruptions. I'm curious if there's a setting or a workaround to prevent Safari 17 from deleting cookies in that way.


Has anyone else encountered this problem, and if so, have you found a solution?

Any insights or guidance would be greatly appreciated.


Thank you in advance for your help!

MacBook Pro 16″, macOS 14.0

Posted on Oct 8, 2023 8:02 AM

Reply
Question marked as Best reply

Posted on Nov 21, 2023 11:38 AM

BrianK90 your link isn't helpful. The issue is that Safari is deleting cookies without us telling it to and what you are sharing there is how to force them to be deleted. We need to stop them from being deleted!

17 replies

Mar 13, 2024 3:36 AM in response to cloudres

Wondering if there is any update on this issue as I see from previously replies it has been happening for a while but I have only recently updated my Macbook to OSX Sonoma and Safari to 17+ and as a web developer this is really annoying!!!


I've been right through the Safari change log and developments notes and cant see anything related to this.

Nov 22, 2023 11:11 PM in response to cloudres

I'm facing this same bug on many sites when a new tab is opened from another tab (window.open). If you open the print dialog, -poof-, Safari apparently kills all cookies in the background. This is with or without the developer menu. If the page you want to print is opened in the SAME tab, the cookies are NOT killed.


Safari 17, Sonoma. A serious bug, which makes Safari unusable in many sites.

Oct 9, 2023 12:56 PM in response to cloudres

Hey cloudres,


Great question! If you haven't yet, we recommend that you check out this user guide on clearing cookies in Safari on macOS Sonoma 14: Clear cookies in Safari on Mac - Apple Support


1. In the Safari app  on your Mac, choose Safari > Settings, then click Privacy.
2. Click Manage Website Data.
3. Select one or more websites, then click Remove or Remove All.
4. Removing the data may reduce tracking, but may also log you out of websites or change website behavior.


If this information doesn't help, we recommend that you submit your valuable feedback to Apple here: Apple Support


We hope this helps!


Best regards.

Apr 25, 2024 9:11 AM in response to cloudres


Try to:


Update Your Software: Start by making sure your macOS and Safari are completely up to date. Apple consistently rolls out updates that tackle various bugs and enhance overall system stability. To look for updates, navigate to the Apple menu, select "System Settings," and then click on "Software Update."


Adjust Cookie Settings: There could be new privacy features in Safari 17 that might inadvertently cause cookies to be deleted when accessing the console. Try tweaking these settings:

  • Open Safari and click on "Preferences" (shortcut: Cmd + ,).
  • Go to the "Privacy" tab.
  • Modify settings like “Block all cookies” and “Prevent cross-site tracking” to see if there’s any improvement.


Explore Alternative Debugging Tools: If the issue continues, consider using other debugging tools as a temporary fix. Applications like Charles Proxy or debugging in a different browser might offer a temporary respite from this problem.


Reset Safari to Default: If none of the above solutions work, resetting Safari might do the trick:

  • In Safari's "Preferences," navigate to the "Advanced" tab and enable “Show Develop menu in menu bar.”
  • Then, select "Develop" from the menu bar, click on "Empty Caches," and also go to "Safari" to "Clear History and Website Data."


I hope one of these steps resolves your issue! Please update me on your progress

Nov 22, 2023 9:11 AM in response to nicholena

Yeah :) I did call into support and have been assigned a case. They are having me do all the things I already have tried, clearing cookies, restarts, etc...and nothing fixes it. It is clearly a bug somewhere in inspector. I have seen it the most consistently when being logged into Gmail and using inspector within another tab that is open to google.com or some other site that is trying to use my Google cookie to auth. I suspect that is where the bug is with multiple tabs accessing the same cookie with inspector open on one of them. I just wish there was a quick way to share that info with an actual Safari dev that could fix it :)

Dec 7, 2023 11:26 AM in response to cloudres

Working with the Web, I often find myself needing to open the console to check the code. Since I upgraded to Sonoma, this task has become a nightmare. Every time, I have to remember to do it with Chrome because Safari 17 wipes everything out. I'm really fed up with this ridiculous bug. I can't count how many times I've accidentally, in a hurry, wiped out all my cookies, forcing me to log in to every site again with all the two-factor authentications. Such a hassle. What a mess!

Apr 25, 2024 8:59 AM in response to cloudres

I had "Show features for web developers" enabled for years and use it daily. But something happened recently that triggered the "randomly log out of all sites" that kills all of the cookies behaviour. I don't know if this started after an update or not. I seem to remember clearing cookies trying to fix a separate issue where Safari would refuse to load pages - no error, not failure, no spinning ball, just a status bar stuck at 50%. Since trying to fix that problem by using Web Developer to clear cookies, it is broken.


Frustrating. I need the developer menu.


Sonoma 14.4.1

Safari Version 17.4.1 (19618.1.15.11.14)


Automatic cookie cleaning in Safari 17 with opened console

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