Cookies not working on Safari (MacOs) and iOS's browsers
Xam-Mlr opened this issue ยท 6 comments
Hi, i'm about to finish my project in React so i'm doing some tests on iPhone. That was a full fail so i checked with a virtual console and i noticed that the react-cookies doesn't work.
(I precise it works well on my macOs laptop with Opera)
Is there any solutions ?
Thanks
I figured out that passing the options object to the setCookie
function with secure
set to true
, the cookie is not set in storage. I made it work by setting the secure
to false
or removing object item altogether.
If I changed secure
to false
it works on Safari but this time, it doesn't work on other Browsers.
I figured out that passing the options object to the
setCookie
function withsecure
set totrue
, the cookie is not set in storage. I made it work by setting thesecure
tofalse
or removing object item altogether.
As @hinciler said, it is one way or the other. Secure true/false only works on Safari or other browsers, but not all of them at the same time. I think this is a critical bug in this library.
I found out that as soon as you remove sameSite=none it works both in chrome and safari
@jordan-jarolim mine doesn't work even after sameSite=none
Unfortunately the library allows you to set the right properties for Safari but you will have to figure out which one it is for your use case.