The iframe I added for the opt out works fine, at least as far as tracking is concerned. If I click on the checkbox it is unchecked and the text of the iframe changes after a reload of the page. If I reload the page again, the "old" text is displayed plus the checkbox is checked again.
However, the cookie for the opt out is set correctly and also works correctly.
But I would like the checkbox and the text to remain after an opt out. Do I have to set anything extra for this or is this a bug?
Thank's a lot and best regards,
Just a wild guess:
Is your iFrame embedded into a different domain as the one Matomo uses and do you have a browser with third party cookies disabled (like Chrom(e|ium) by default?
The Matomo is used on a subdomain of the main domain.
I first thought it was the cookie banner, but that doesn't seem to be the problem. I set these two necessary cookies:
In Matomo I deactivated tracking with cookies maybe that's also an important information.
Is there any chance you could post a URL to the page where we can reproduce this? It be otherwise hard to reproduce or guess what the problem might be @samuel-lobby
It was trying to set an ignore cookie
but it wasn't set afterwards somehow. Nothing related in the logs, no issues.
Not sure what the problem might be.
@samuel-lobby I think you might not be using the latest version of Matomo? Is there any chance you could upgrade to see if that fixes it maybe?
@tsteur I use Matomo 4.4.1. I made the update to this version after I recognized that this opt out iframe isn't working as it should. So maybe the cookie matomo_ignore is blocked from the cookie consent mananger?
@tsteur After checking myself, I noticed the reason why the cookie isn't set: The expiration date is
expires=Mon, 09-Aug-1915 07:50:25 GMT; secure; SameSite=None.
@Findus23 you're right. Why is this happening? Can I control this expiration date?
Matomo sets the expiration date to 30 years from now:
So for a starter you could check the output of this PHP script:
<?php var_dump(time()); var_dump(time() + (86400 * 365 * 30));
But it is most likely a 32 bit overflow somewhere:
30 years from now is
2578918957 in unix time.
2578918957- 2^32 = -1716048339 and
-1716048339 in unix time is in August 1915.
So can you describe your server setup a bit more? Which operating system are you using? Which PHP version?
the crm system: TYPO3 (9.5)
PHP version: 7.2.34
The Website is hosted at Domainfactory.
Do you need some more infos?
I suppose this means we might also need to change other places? If I see this right the only thing we maybe can do about this add a system check mentioning 64 bit system / PHP required?
We could possibly make it work for this particular case to generate a date in 30+ years using something like
str_replace('current year', 'current year +30 years', Date::now()->getDatetime()) if we could pass string as expires in the cookie method.
But generally there might be other places where there are also issues?
@tsteur what can I do in the meantime? Or do I have to wait until it's released with an update of matomo?
@samuel-lobby is there any chance you can ask your hoster if they can update your site to a 64 bit system?
To fix this specific issue maybe we can refactor the opt out cookie to calculate 30 years in the future differently instead of using a timestamp etc use something like this (pseudo code)
str_replace('current year', 'current year +30 years', Date::now()->getDatetime().
The goal of this issue is to make the opt out work when a PHP 32 bit is used see https://github.com/matomo-org/matomo/issues/18019#issuecomment-924360242