Open morus12 opened 4 years ago
We are having the same issue. Console log is spammed with the missing sameSite warnings. On v7.1, areCookiesEnabled
is to blame:
set
with no options, so the sameSite warnings will be printed everytime.
const areCookiesEnabled = () => {
const uid = String(new Date());
try {
const cookieName = Constants.COOKIE_TEST + base64Id();
set(cookieName, uid, {});
const _areCookiesEnabled = get(cookieName + '=') === uid;
set(cookieName, null, {});
return _areCookiesEnabled;
} catch (e) {}
return false;
};
Any update on this issue? Do you have any plans to take care of it? We're receiving many complains from our customers about missing same site attr for cookies and Amplitude is the only thing left to fix it.
Hi @quarties ! sorry for the lack of communication - we flagged this as an issue a few weeks back and are hoping to resolve this in the coming (~1 -2) weeks - we'll keep you posted!
@kelvin-lu thanks a lot! I really appreciate your effort <3
Hello, I'm still getting this warning on firefox (I see nothing in Chrome, but no amp_cookie_test is visible in the local storage, so perhaps the warning is just not visible ?)
Cookie “amp_cookie_testHrIiHKBjFaeV7QkRhp-S9k” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
I also see
Cookie “amplitude_test” has been rejected for invalid domain.
Though I see there was a fix in v.7.2.0, I've been using the 7.3.3 and still see the error.
I'm seeing this as well on Firefox using 8.18.1
. Any updates here? @kelvin-lu
This warning shows up even with
sameSite
configured.It's because the function
areCookiesEnabled
sets the cookies and is called beforesameSite
attribute is set. https://github.com/amplitude/Amplitude-JavaScript/blob/92829d1588db8eb01fcefa84ee8951ede3543459/src/metadata-storage.js#L12-L21