Error setting cookie after upgrade to 4.4.1

Checked in multiple browsers, private mode etc. Seems to only happen when the page with Matomo installed is IFRAMEd. Any ideas?

piwik.js:12 There was an error setting cookie _pk_ses.1228.158f. Please check domain and path.
ak @ piwik.js:12
df @ piwik.js:33
cd @ piwik.js:41
cr @ piwik.js:44
b1 @ piwik.js:45
(anonymous) @ piwik.js:61
ch @ piwik.js:50
P.trackPageView @ piwik.js:61
af @ piwik.js:12
ad @ piwik.js:66
addTracker @ piwik.js:68
(anonymous) @ piwik.js:71
(anonymous) @ piwik.js:71

Hi @fatica ? Did you solve the issue? I am also getting the same issue. I need to use third party website as Iframe. So how to fix the following error.

There was an error setting cookie `_pk_ref.2.1176`. Please check domain and path.
ak @ matomo.js:12
df @ matomo.js:33
cr @ matomo.js:43
b1 @ matomo.js:45
(anonymous) @ matomo.js:61
ch @ matomo.js:50
P.trackPageView @ matomo.js:61
af @ matomo.js:12
ad @ matomo.js:66
addTracker @ matomo.js:68
(anonymous) @ matomo.js:71
(anonymous) @ matomo.js:71

1 Like

Hi to both of you.

This issue has been reported and fixed here:

Apart from displaying the message in the console everything works just as it should (so the bug is just displaying the message)

Yes, ensuring full HTTPs, plus the addition of

_paq.push([ā€˜setCookieSameSiteā€™, ā€˜Noneā€™]);

in the tracking code addressed the issue for me.

Iā€™m not sure what the side effects of [ā€˜setCookieSameSiteā€™, ā€˜Noneā€™] are, so Iā€™d recommend to instead either leave the warning alone until 4.5.0 or apply the real fix from

This isnā€™t the same (AFAIK) as the consent cookie,

Notice our error is
there was an error setting cookie _pk_ref.2.1176.

This is a newer issue in Chrome et.al to allow 3rd party cookies. You can see the error come back if you go into incognito mode.

Ref:

Hi,

My point is that the whole There was an error setting cookie message isnā€™t a new bug, but instead a new check that was added in https://github.com/matomo-org/matomo/pull/17744 (4.4.0) to see if any cookie that was created was actually existing. And if not, print this warning so issues can be easier debugged. But the logic was wrong and so the warning is now also shown in cases where everything is working fine (more precisely whenever a non-string is written to a cookie).

So it should not matter for this warning which cookie is written.

Unless of course this still occurs after applying https://github.com/matomo-org/matomo/pull/17928 which means that there might actually be an issue with writing the cookie.