Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When the "Enable floating privacy settings tab and withdraw consent banner" is set, users can withdraw their consent anytime if they change their mind. If they start by disagreeing to give their consent, they can never go back unless they know how to wipe their cookies.
Proposed resolution
Add an option to show the cookie management tab toggle even when the user has disagreed to give their consent. Clicking the button would show the initial cookie information banner again, letting the user choose another option.
Comment | File | Size | Author |
---|
Comments
Comment #2
j.b CreditAttribution: j.b commentedI agree, users do not see the cookie banner once they withdraw consent although the cookie agreed status is set to 0.
We need to wipe out the cookie for the banner to be displayed again.
Comment #3
idiaz.ronceroHello;
This is a small patch that adds a checkbox under "Withdraw Consent", on the module settings.
If active, it will populate drupalSettings.eu_cookie_compliance.withdraw_reprompt and act conditionally.
If set to TRUE, Drupal.eu_cookie_compliance.withdrawAction() will set the status to NULL, effectively re-asking the user again on the next page load.
If set to FALSE, the default behavior will apply, status will be set to 0 as if the user had declined.
Feel free to review and test it.
Comment #4
idiaz.ronceroSorry, that was wrong. This is the correct patch:
Comment #5
idiaz.ronceroComment #6
idiaz.ronceroComment #7
idiaz.ronceroSorry, I've just realized this patch (that I made for a project) it's not addressing the proposed solution. It works for a similar (but not equal) scenario.
For a solution that allows the user to re-enable the cookies after declining them, you can check the patch on https://www.drupal.org/project/eu_cookie_compliance/issues/3083863
My patch is designed for a different case: re-prompt for cookies to any user that enables cookies, and then withdraws its consent using the withdraw tab. It might sound strange to re-prompt a user that has decided to decline its consent, but when you're using categories this makes sense: you want to be able to let the user choose again, not just assume that it wants to withdraw from everything.
Comment #8
idiaz.ronceroAdded a new issue for my patch: When using categories, consent withdraw should let users select categories
I'll move my work to that issue, sorry for my mistake.
Comment #9
idiaz.ronceroComment #10
leymannxYou may then close this issue as duplicate of your newer issue. Or is this issue still active?
Comment #11
idiaz.ronceroThis is still open, the patch and issue I created is for a very similar but slightly different scenario.
Comment #12
idiaz.ronceroComment #13
AnybodyComment #14
AnybodyComment #15
reszlitested, and attached patches work to achieve Approach 1nvm, this refers to #3109910: When using categories, consent withdraw should let users select categories
Comment #16
reszliComment #17
svenryen CreditAttribution: svenryen at Ramsalt Lab commented@reszli, is this a duplicate of the work committed in a different issue?
Comment #18
Anybody@reszli re#15: Could you perhaps have a look again so we can push this forward or close it?
Comment #19
alternativo CreditAttribution: alternativo as a volunteer commentedHi guys, I think this is a good solution, but it's not so nice to have always the privacy button on the top or bottom of my site.
Maybe it would be perfect to let the privacy button for user who want to change cookies option appear only in the privacy policy page?
Do you think it could be possible to do?
thanks
regards
Comment #20
svenryen CreditAttribution: svenryen at Ramsalt Lab commented@alternativo, would you please open a new issue? What you're asking for is not what we're discussing here. Please also provide a patch if possible.
Comment #21
alternativo CreditAttribution: alternativo as a volunteer commented@svenryen thanks for the reply.
I solved in that way, as I found other similar issues, and inspire by @Anybody in #12
https://www.drupal.org/project/eu_cookie_compliance/issues/2985390
I used a button with
'<'p'>'
'<'a href="#" onclick="Drupal.eu_cookie_compliance.toggleWithdrawBanner(); return false;"'>'
CHANGE COMPLIANCE CHOISE'<'/a'>'
'<'/p'>'
and put in eu_cookie_compliance.css display:none property in the withdraw button
Regards
Comment #22
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedNow that #3083863: Change cookie option after withdrawing went in, do we still need this patch?
Comment #23
svenryen CreditAttribution: svenryen at Ramsalt Lab commentedComment #24
svenryen CreditAttribution: svenryen at Ramsalt Lab commented