Problem/Motivation
The language switcher is cached globally per language. This causes issues when the first visitor navigates to a page, because the current url is cached for all subsequent page requests within the same language. If the visitor decides to view the cookie popup in a different language the visitor is redirected to the first cached page during the building of the cookie data, which will most likely not be the page the visitor requested.
The issue is caused by eu_cookie_compliance project caching per language: https://www.drupal.org/project/eu_cookie_compliance/issues/3196558 #3196558
Steps to reproduce
install the module on a site with multiple languages: EN & some other language
In incognito modus of browser A: Navigate to the English contact page
In incognito modus of browser B: Navigate to the English homepage
The visitor of browser B will have localization links to the contact page while it is supposed to be localized links to the homepage.
Proposed resolution
Implement a hook to alter the cache id of EU cookie compliance and include the route data in the cid.
Issue fork eu_cookie_compliance_rocketship-3196585
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3196585-alter-eu-cookie-cid
changes, plain diff MR !1
Comments
Comment #3
thierry.beeckmans commentedComment #6
rembrandx commentedComment #8
rembrandx commentedComment #9
rembrandx commentedComment #11
rembrandx commented