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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuaelFr created an issue. See original summary.

j.b’s picture

I 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.

idiaz.roncero’s picture

Hello;

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.

idiaz.roncero’s picture

Status: Active » Needs review
idiaz.roncero’s picture

idiaz.roncero’s picture

Sorry, 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.

idiaz.roncero’s picture

Added 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.

leymannx’s picture

You may then close this issue as duplicate of your newer issue. Or is this issue still active?

idiaz.roncero’s picture

This is still open, the patch and issue I created is for a very similar but slightly different scenario.

idiaz.roncero’s picture

Status: Needs review » Needs work
Anybody’s picture

Anybody’s picture

reszli’s picture

Status: Needs work » Reviewed & tested by the community

tested, and attached patches work to achieve Approach 1
nvm, this refers to #3109910: When using categories, consent withdraw should let users select categories

reszli’s picture

Status: Reviewed & tested by the community » Needs work
svenryen’s picture

@reszli, is this a duplicate of the work committed in a different issue?

Anybody’s picture

@reszli re#15: Could you perhaps have a look again so we can push this forward or close it?

alternativo’s picture

Hi 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

svenryen’s picture

@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.

alternativo’s picture

@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

svenryen’s picture

Now that #3083863: Change cookie option after withdrawing went in, do we still need this patch?

svenryen’s picture

Status: Needs work » Postponed (maintainer needs more info)
svenryen’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)