Change the expire time set by Drupal.toolbar.collapse() for its cookie

Created on 20 May 2018, over 6 years ago
Updated 11 April 2024, 10 months ago

Drupal.toolbar.collapse() sets the cookie expire time with the following code.

  $.cookie(
    'Drupal.toolbar.collapsed',
    1,
    {
      // Workaround lack of support for the SameSite attribute in jQuery Cookie.
      path: Drupal.settings.basePath + '; SameSite=Lax',
      // The cookie should "never" expire.
      expires: 36500
    }
  );

That is an exceptional length of time and it will cause sites to fail the EU cookie compliance test. Please either shorten it to (say) 40 days, or provide a method of sites setting the cookie lifetime themselves.

Feature request
Status

Needs review

Version

7.0 ⚰️

Component
Toolbar 

Last updated 14 days ago

  • Maintained by
  • 🇫🇷France @nod_
Created by

🇬🇧United Kingdom Bessaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024