Problem/Motivation
Sometimes, we need to be able to disable the Automatic Cookies Removal (but we can still be GDPR compliant).
To do so, for now we have to fill-up the whitelisted_cookies field, but sometimes we can't as the cookies are randomly generated.
Proposed resolution
Having a new checkbox which allows enabling or disabling the Automatic Cookies Removal.
To prevent any regression on production project, I would suggest checking this option by default.
By doing this we will ensure the same behaviour as now.
Remaining tasks
- reviews needed
User interface changes
A new Checkbox appears on the Backend with the following label "Enable cookie(s) automatic-removal when consent isn't given."
Comments
Comment #2
wengerkHere is a first draft, let's tests it by Testbot.
And many thanks for your review and help !
Comment #4
wengerkFix a tiny code quality flaws I introduce
src/Form/EuCookieComplianceConfigForm.phpThe 2 others flaws have not been introduce by my patch, it would be out-of-scoop to fix them here.
Comment #6
wengerkComment #7
anybodyI guess this should be discussed in detail. If this option is once in, it will be hard to be removed or altered!
Candidate for 8.x-2.x! #3130662: Roadmap to 2.0.x release
Comment #8
aerzas commentedSince the latest release, the `eu_cookie_compliance_update_8115` function is declared and the proposed patch creates a duplicated function. Here is quick update of the patch expected version.
Comment #9
kimberleycgmI had been working on a very similar implementation (https://www.drupal.org/project/eu_cookie_compliance/issues/3153194) for this problem and hadn't seen this issue at the time.
I've switched out my patch for this one on my site and it's working as expected. I did have an issue in one of my sessions with cookies being cleared out still, but I don't think it was related to this. A new incognito session logged out and logged in worked well.
I've now closed the other issue as a duplicate of this.
Comment #10
kimberleycgmOne query though - on this line
'automatic_cookies_removal' => !empty($config->get('automatic_cookies_removal')) ? $config->get('automatic_cookies_removal') : FALSE,would it be better to set the fallback value toTRUEinstead (as that's the current behaviour)? And do a check on the data being set, rather than empty?Comment #11
svenryen commentedAgreed. I made this change and tested the patch. Works great! Thanks for the contribution!
Comment #12
svenryen commentedHere's the updated patch.
Comment #15
anybodyDrupal 7 Backport in: #3177170: [7.x-1.x] Backport cookie removal checkbox from D8 to D7 version