Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Geolocation esForms-country cookie gets cached and breaks page caching #438

Open
dingo-d opened this issue Aug 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dingo-d
Copy link
Collaborator

dingo-d commented Aug 1, 2024

In the case you have a caching layer such as Cloudflare, the cookie esForms-country will get cached and will be set incorrectly for any subsequent user. Say for instance that the non-cached page was requested by a Hungarian user, this cookie will be set to esForms-country=HU, and then any other user, no matter where they are from, will have this cookie set.

I'm not sure if this is still being used (seeing from the code I think it is in Geolocation.php and geolocation.js), but I've also noticed the cookieless setup that was merged in #370 so I'm not sure if this is used or not.

This cookie should be set only on specific page, where it is needed, not globally.

This is further affecting things such as Varnish cache, as it will disable page caching there.

There should be fallback cases, such that the geolocation info is pulled from the caching layer first (https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#cf-ipcountry).

@dingo-d dingo-d added the bug Something isn't working label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants