Cookies and storage

By default, the Didomi CMP uses first-party cookies to store consent information. Consent is stored in the base domain and shared across all the subdomains of the base domain where the SDK is deployed.

Example: If you install Didomi on www.domain.com, consents will be stored in a cookie on .domain.com and all sub-domains of domain.com will have access to the same consent information.

Store consent on a different domain (subdomain)

If you want to store the first-party cookie on a specific sub-domain, you can add this option into the configuration.

Consents will be shared only to pages with this specific sub-domain.

window.didomiConfig = {
cookies: {
local: {
customDomain: 'privacy.your-domain.com'
}
}
};

Cookie name

The Didomi SDK uses two cookies and local storage items for storing user consent:

  • didomi_token for non-IAB vendors and purposes

  • euconsent-v2 for IAB vendors and purposes

The name of the didomi_token cookie can be modified if you want to use a different name by setting the cookies.didomiTokenCookieName property:

window.didomiConfig = {
cookies: {
didomiTokenCookieName: 'custom_cookie_name'
}
};

Keep in mind that modifying the cookie name on a website that already had the Didomi SDK installed will recollect consent. We recommend using a short cookie name.