Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2022 at 13:01 UTC
Updated:
1 May 2022 at 09:14 UTC
Jump to comment: Most recent
Comments
Comment #3
john_b commentedI fear that the D7 issue in #3261155: We sometimes hit the cache before getting geographic location may affect D8/9 too. In other words, the non-JS is unreliable. I mentioned this in passing in an unrelated issue.
For geolocation to be reliable we have got have a session for every visit. I can load the site in Austria, where smart_ip correctly detects my location, get a 200, with no session cookie or session storage being set in the browser. I am using smart_ip. There is no server caching--I am not using a VPN or Varnish, and the server is my own basic Apache + php-fpm setup. I have just tested this in Edge.
Arguably the problem is with smart_ip. In testing on D7, session_cache module did not fix the problem. Anyway, it does not exist for D8/9.
I do not know whether geolocation can fail if a session is set.
Another argument is that is undesirable for EU Cookie Compliance to rely on setting a session for anonymous, so there would be case for removing the non-JS option even if it were working reliable.
Comment #4
svenryen commented@John_B: I tested this from my localhost as Anonymous as well as on a mobile phone using VPN from both a non-GDPR and GDPR country. It seemed to work really well based on my testing and did resolve the issue that was seen when the patch wasn't added.
I would expect geolocation to always work when a session is set. Do you have any steps I can use to make geolocation fail when a session is set?
I'll re-test again from TWO phones today (both as anonymous and with a session) to make sure the patch still resolves the issue.
Comment #5
john_b commentedMy main point was that Geolocation was failing in my test and no session cookie (or EU Cookie Consent cookie) was seen in Edge dev tools.
The question about whether it could also fail when a session is set was not relevant, just me thinking alound.
I have just reproduced this in Chrome.
STEPS:
I am in Austria, no VPN, and an IP which Max-mind identifies correctly according to the smart_ip test form. D9.3.9, Apache 2.4.53, PHP 8.1, no reverse proxy.
Set EU Cookie Compliance to EU Only and save.
Initially the banner appears on page load.
Load the site a few times so the cache is warm.
Clear all cookies and cache in Chrome.
Enter the URL in the address bar and hit "Enter".
Check in Network tab that we are getting a 200 on the HTML doc.
No banner appears. No Drupal session cookie (or other cookie) is set. No Session storage is set.
Comment #6
svenryen commentedIs this the JS version or the non-JS version you're using? Is the Smart IP module enabled and what are its settings?
Do you see he same behavior with D7 and D8?
Did you apply the patch from the issue fork?
I'm not able to reproduce your scenario when I use this patch and the option that now's called "Use JavaScript to determine if the visitor is in a country where GDPR applies".
Comment #7
john_b commentedThis is the non-JS version, with the JS version unset. Behaviour is same on D7.
I did not apply the patch, which appears only to affect the settings form.
smart_ip is using GeoIP Maxmind Precision, Country-level. "Save user's location details upon creation" and "Don't save location details of visitors from GDPR countries" are on (but probably not relevant as I am only testing on anonymous). Debug is off.
The JS version works.
Happy to do a screen share so you can see the bug yourself.
Comment #8
svenryen commentedSince you're using the non-JS version, can I assume there's no caching involved? No browser cache, no external cache and no cache in the Drupal database for the page in question?
Comment #9
svenryen commentedHere are the steps I've taken to try to reproduce:
1) Set the option to what used to be called "Only display banner in EU countries" (non-JS)
2) Disable Page cache and Dynamic cache modules (and any other caching you may have enabled)
3) Turn my phone to 4G and enable VPN with a US IP address
4) Clear all cookies
5) Access the test IP and load the page => notice there's no banner
6) Set the VPN to a European IP
7) Clear all cookies
8) Access the test IP and load the page => notice there's now a banner showing
If your steps gives a different result, I would be happy to go on a screen share with you to learn what I've missed.
Comment #10
john_b commentedSorry, I made a mistake. Somehow I was expecting the non-JS version to work with caching enabled on D8.
Comment #12
svenryen commented