Skip to content

Error Message "There was an error setting cookie mtm_consent_removed. Please check domain and path" on every page load, when requireConsent option is set #19488

@Constantin-Init

Description

@Constantin-Init

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 9e10a15

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions