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.
1
window.didomiConfig = {
2
cookies: {
3
local: {
4
customDomain: 'privacy.your-domain.com'
5
}
6
}
7
};
Copied!

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:
1
window.didomiConfig = {
2
cookies: {
3
didomiTokenCookieName: 'custom_cookie_name'
4
}
5
};
Copied!
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.

Storage sources for user information

By default, the Web SDK stores user information and choices in both cookies and local storage. You can configure where user information and choices should be stored and use only cookies or local storage if you want to.
Set cookies.storageSources.cookies to false to disable storing data in cookies. Similarly, set cookies.storageSources.localStorage to false to disable storing data in local storage.
For instance, to configure the Web SDK to use local storage only:
1
window.didomiConfig = {
2
cookies: {
3
storageSources: {
4
cookies: false,
5
localStorage: true
6
}
7
}
8
};
Copied!
Last modified 7mo ago