The standalone opt-out was interpreting no 'consent cookie' or 'remove consent cookie' to mean the user was opted out, which is incorrect. An extra check has been added so that if neither the 'consent cookie' or the 'remove consent' cookie are set the the user is considered to be currently opted-in.
This pull request has been mentioned on Matomo forums. There might be relevant details there:
Good morning, I am a Matomo Cloud customer. I would like to report a bug about the code you provided with the opt-out js (from the Matomo backend). When I visit the page where the form is present and then I refresh, the data is changed automatically (example: once it is checked, the next time it is not and so on). Link where the form is present and the bug can be reproduced: https://drapersitaly.it/it-it/cookie-policy/
@KarthikRaja1388 can I convert the comment to an issue ticket?
When I visit the page where the form is present and then I refresh, the data is changed automatically (example: once it is checked, the next time it is not and so on)
This PR should fix that problem once it's released, not sure we need a new issue for it?