@Constantin-Init opened this Issue on July 7th 2022

When the requireConsent option is set, every page load logs the error message "There was an error setting cookie mtm_consent_removed. Please check domain and path" to the console.

Reason seems to be that during creation of a Tracker forgetConsentGiven is being called, which then calls setCookie(CONSENT_REMOVED_COOKIE_NAME, ...). setCookie sets the cookie properly, but wants to check that it is indeed set with a call to get getCookie, which then fails, because configCookiesDisabled is set to true at this point, and the function returns 0

Fix would be make the behavior of getCookie and setCookie in regards to the CONSENT_REMOVED_COOKIE_NAME and configCookiesDisabled the same.
The change to setCookie was introduced here https://github.com/matomo-org/matomo/commit/9e10a150585522ca30ecdd275007a882a70c6df5

@sgiehl commented on July 7th 2022 Member

Hi @Constantin-Init
Thanks for creating this issue. Guess this should be easily fixed by doing the same check in getCookie as well.
I'll put up a PR to fix that.

This Issue was closed on July 8th 2022
Powered by GitHub Issue Mirror