Problem/Motivation

Olivero Theme sets every time the localStorage item Drupal.olivero.stickyHeaderState. Storing data in user's browser (no matter if cookie, localStorage or sessionStorage) requires in many countries the user's consent - e.g. in the countries of the European Union.

Steps to reproduce

Install Drupal with Olivero and open the home page.

Proposed resolution

The aim should be to avoid data protection violations without the need for a consent manager. The use of localStorage is permitted if it is necessary for the provision of the requested service. It would therefore be a step in the right direction if the localStorage were only used after the toggle button has been pressed.

(Ideally, the use of localStorage should only be optional and become a theme setting, but the data protection officers are welcome to discuss this first).

Remaining tasks

Introduce a javascript function updateStickyHeaderStorage() which only sets the expiration time if the item exists.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

Avoid the unnecessary use of localStorage to comply with data protection regulations.

Issue fork drupal-3487874

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

jan kellermann created an issue. See original summary.

jan kellermann’s picture

Title: Oliviero: Violation of data protection regulations » Olivero: Violation of data protection regulations
jan kellermann’s picture

Issue summary: View changes
jan kellermann’s picture

Status: Active » Needs review

Created MR. Please review.

jan kellermann’s picture

Title: Olivero: Violation of data protection regulations » Olivero: Prevent violation of data protection regulations
Issue summary: View changes
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks for reporting, we could use a test case showing this as a problem.

jan kellermann’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests +Privacy improvements

Thank for your comment. I added the test.

Please review.

valthebald’s picture

As far as stickyHeaderState is entirely client-processed and is not collected/processed by the server (who should it be?), I'd argue it's not a subject to GDPR or similar regulations.
GDPR, as it states in the very first article, is about

...rules relating to the protection of natural persons with regard to the processing of personal data and rules relating to the free movement of personal data.

since there is no processing of personal data, I'd say there is no need to get user consent

longwave’s picture

+1 to #9. GDPR is only relevant to the processing of personal data, this is kept entirely client side and cannot be used to track or identify a user so I believe this usage of localStorage is exempt.

jan kellermann’s picture

@valthebald and @longwave are right, that this is not a violation of the GDPR - but of the EU ePrivacy Directive and national laws in european countries (since 2002!).

The ePrivacy Directive Art. 5 (3) says, that you need users’ consent before you "store information" (cookies, localStorage etc.) "in the terminal equipment of a subscriber or user" (e.g. browser) except "strictly necessary" data. This EU directive is not a direct law, but is implemented by national laws, in Germany the TDDDG and in Spain the LSSI for example.

The new EU e-Privacy Regulation is currently being drafted; this will replace the directive and will then become direct law (in the same way as the GDPR). According to the current status, it contains an analogous passage, see Article 8 "Protection of information stored in and related to end-users’ terminal equipment":

It is not about which data is processed, but about the protection of the visitor's end device - so it does not matter whether it is a tracking, 1st or 3rd party cookie.

It is a violation in all european countries.

Edit: And for the UK, too, see PECR

valthebald’s picture

@jan kellermann I'm equally amazed by your knowledge of the EU laws as I am disappointed by implied restrictions to deliver meaningful functionality to our clients...

jan kellermann’s picture

@valthebald My MR does not cause any disadvantages for the users: LocalStorage is only used when it is needed. This is a responsible approach in terms of the law. For example, the theme writes the entry in the LocalStorage for mobile users who never get to see the menu switch - you can't talk about “technically necessary” here.

jan kellermann’s picture

Title: Olivero: Prevent violation of data protection regulations » Olivero: Avoid localStorage for anonymous user to prevent violation of data protection regulations
Issue tags: -GDPR
longwave’s picture

Should we just change setStickyHeaderStorage() to delete the localStorage entry if the passed value is false?

jan kellermann’s picture

Great idea, @longwave!

Since there's no reason to save the false state, I'll remove it now.

I added this to javascript and also to the test.

jurgenhaas’s picture

Status: Needs review » Reviewed & tested by the community

Works as expected. Maybe this needs a Drupal CMS Release tag, I will ping @pameeela about it.

pameeela’s picture

Would be great to get this into our initial release if possible.

filipeabreu’s picture

StatusFileSize
new30.01 KB
new235.03 KB
new221.93 KB

I added diff file https://git.drupalcode.org/project/drupal/-/merge_requests/10208.diff of MR https://git.drupalcode.org/project/drupal/-/merge_requests/10208 as a patch and it could be applied properly. Also, the expected result worked fine.

Patch:
patch

Before:
Before patch

After:
After patch

My local setup settings:

  • Drupal 11.1.0
  • Web Server: nginx/1.26.1
  • PHP: 8.3.10
  • Database: MariaDB 10.11.8

  • longwave committed 7ba9c195 on 11.1.x
    Issue #3487874 by jan kellermann, filipeabreu, valthebald, longwave:...

  • longwave committed 5e89fa50 on 11.x
    Issue #3487874 by jan kellermann, filipeabreu, valthebald, longwave:...
longwave’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 5e89fa50893 to 11.x and 7ba9c1951c7 to 11.1.x. Thanks!

Status: Fixed » Closed (fixed)

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