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.

Command icon 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:

Comments

thierry.beeckmans created an issue. See original summary.

thierry.beeckmans’s picture

Issue summary: View changes
Related issues: +#3196558: Cache id alterations

L_VanDamme made their first commit to this issue’s fork.

rembrandx’s picture

Status: Active » Reviewed & tested by the community

  • rembrandx committed e41f4d6 on 1.0.x
    Issue #3196585 by L_VanDamme: Cache the cookie popup per page + resolve...
rembrandx’s picture

Version: 1.0.x-dev » 1.0.0-alpha3
Status: Reviewed & tested by the community » Fixed
rembrandx’s picture

Version: 1.0.0-alpha3 » 1.0.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rembrandx’s picture

Version: 1.0.x-dev » 1.0.0-alpha4