Safari: Cookies stored under Storage > Cookies do not match the ones listed on document.cookie

Hi!

I'm facing the following issue in different versions of Safari:

When removing cookies via PHP on log out of an application I can see that the Safari Developer Tools > Storage > Cookies (of the website) removes the cookies from the list. So my user cookie is no longer there as expected, all good.

However, if I run document.cookie on the console or document.cookie.includes('user') I can see the cookie listed there. I would expect the document.cookie to be updated with the Storage tab as it happens on the other browsers. Does anyone know why is this happening? Is there anything special that must be done for Safari to remove the cookie from there?

This behaviour is consistent in versions v14, v15 and v16 of Safari.

Thank you for your time.

Regards, Borja.

I am facing exactly the same issue. document.cookie does not contain the same as what is displayed in the Storage > Cookies tab. The deleted cookie from application A a.mydomain.com (set on parent domain: mydomain.com) on logout is not visible from the panel of the application B tab. This is the expected behavior. But the cookie is still in document.cookie in application B leading to many side effects, even after refreshing the page. It is like as if document.cookie is not refreshed properly. On the opposite, chrome and firefox are working as expected.

Did you find a solution?

I guess this is a major bug on safari.

Safari: Cookies stored under Storage > Cookies do not match the ones listed on document.cookie
 
 
Q