This module provides the js-cookie JavaScript library for use in Drupal projects, particularly for versions where it's no longer included by default. It allows developers to easily integrate and manage cookies using JavaScript in their Drupal sites.
Provides a Drupal library definition for the JavaScript Cookie library (js-cookie) after it was deprecated in Drupal 10 and removed from Drupal 11.
Instructions
Installing this module and the library dependency
Follow the README.md instructions
Using this module as dependency for the js-cookie library (as developer)
- If using this in a custom module, run
composer require drupal/js_cookiefrom your project root. - If using this in a contributed module, make sure to list
js_cookie:js_cookiein your module's.info.ymlfile dependencies. If your contributed module also has a manualcomposer.jsonfile, make sure to add arequiredependency on"drupal/js_cookie": "^1.0". - Replace any of your
.libraries.ymldependencies oncore/js-cookiewithjs_cookie/js-cookie.
Avoid using CDN (Privacy)
To avoid using CDN see README for more information.
Ask your assistant about JS Cookie
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
19 tracked projects depend on this one
- Fast Permissions Administration 12,561 sites
- Siteimprove.ai 7,829 sites
- Collapsiblock 5,807 sites
- Popup message 5,763 sites
- The CodeMirror Editor 4,637 sites
- Modal 3,221 sites
- Bootstrap Site Alert 1,731 sites
- SimpleAds 1,227 sites
- Language Cookie 1,121 sites
- Cookie Content Blocker 655 sites
- Google Tag Manager: Events 356 sites
- Simplifying 343 sites
- Like! 151 sites
- Recombee 46 sites
- Prehome 36 sites
- FullStory Integration 36 sites
- Personified 10 sites
- Smart Content CDN 9 sites
- CookieCuttr 3 sites
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.3 | Stable | 10–11 | Nov 19, 2026 | ||
| 2.0.2 | Stable | 11 | Nov 19, 2026 | ||
| 2.0.1 | Stable | 11 | Dec 15, 2025 | ||
| 2.0.1-rc1 | Pre-release | 11 | Dec 3, 2025 | ||
| 2.x-dev | Dev | 11 | Dec 3, 2025 | ||
| 1.0.2 | Stable | 9–11 | Nov 3, 2025 | ||
| 1.0.1 | Stable | 9–11 | Sep 5, 2023 | ||
| 1.0.0 | Stable | Sep 5, 2023 | |||
| 1.x-dev | Dev | 9–11 | Sep 5, 2023 |