Download the PHP package jostkleigrewe/cookie-consent-bundle without Composer

On this page you can find all versions of the php package jostkleigrewe/cookie-consent-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cookie-consent-bundle

Symfony Cookie Consent Bundle โ€“ GDPR/DSGVO Cookie Banner with Google Consent Mode v2

Packagist Version Packagist Downloads PHP Version CI

A modern Symfony 8 bundle for GDPR/DSGVO-compliant cookie consent management. Includes Google Consent Mode v2 support, Twig components, Stimulus.js integration, and AssetMapper compatibility. Perfect for cookie banners, consent modals, and privacy-compliant websites.

๐Ÿ“– Documentation

Why this bundle?

Screenshot

Features

Requirements

Compatibility

Bundle Version PHP Symfony
0.4.x 8.4+ 8.0+
0.3.x 8.3+ 7.1+
0.2.x 8.2+ 7.0+

Quick Start

1. Install

2. Register routes

Create config/routes/cookie_consent.yaml:

This registers the /_cookie-consent endpoint required for consent updates.

3. Configure assets

Option A: Twig helper (CSP-compatible, recommended)

This renders a standard <link> tag, fully compatible with strict Content-Security-Policy headers.

Option B: JavaScript import

Note: With strict CSP (style-src 'self'), bundlers may convert CSS imports to data: URLs, which can be blocked. Use Option A if you encounter CSP issues.

4. Render the modal

5. Gate content by consent

Or use lazy loading:

Configuration

Create config/packages/cookie_consent.yaml:

Storage Modes

Mode Description Use Case
cookie Browser cookie only (default) Simple sites, no DB required
doctrine Database only via Doctrine ORM Server-side consent verification
both Cookie + Database (cookie as primary, DB as backup) Full audit trail + fast access

If storage is set to doctrine or both, generate migrations in your app (bundle ships entities, not migrations). This requires Doctrine ORM:

Increment policy_version when changing categories to require re-consent.

If logging.retention_days is set, run the cleanup command regularly:

Documentation

Embed Components

Gate third-party content with built-in components:

Alternative:

Available: YouTube, Vimeo, Google Maps, Spotify, Twitter/X, Instagram, TikTok, and more.

Integration Overview

See Integration for Twig components, helpers, data attributes, controller attributes, and events.

Troubleshooting

Modal doesn't appear

Assets not loading (404)

Session cookie created before consent

Doctrine storage not working

Google Consent Mode not updating

Tabler variant styling issues (missing border-radius, labels below checkbox)

Contributing

License

MIT - see LICENSE.

Resources

Keywords

Symfony cookie consent, GDPR cookie banner, DSGVO cookie modal, Google Consent Mode v2, Symfony 8 bundle, cookie management, consent management platform, CMP, Twig cookie component, Stimulus.js cookie, AssetMapper, Doctrine consent storage, YouTube embed consent, privacy compliance, e-privacy.


All versions of cookie-consent-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
psr/log Version ^3.0
symfony/asset Version ^8.0
symfony/asset-mapper Version ^8.0
symfony/config Version ^8.0
symfony/console Version ^8.0
symfony/dependency-injection Version ^8.0
symfony/framework-bundle Version ^8.0
symfony/http-foundation Version ^8.0
symfony/http-kernel Version ^8.0
symfony/security-csrf Version ^8.0
symfony/security-http Version ^8.0
symfony/stimulus-bundle Version ^2.0
symfony/twig-bundle Version ^8.0
symfony/ux-twig-component Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jostkleigrewe/cookie-consent-bundle contains the following files

Loading the files please wait ...