Find out why each subdomain asks again and share one answer across them
The TermsFeed Free Cookie Consent banner asks again on a subdomain when the consent cookies do not cover that subdomain. Cookie Consent writes its 3 cookies for the page hostname alone unless cookie_domain names a parent domain. An answer on www.example.com then does not hide the consent banner on shop.example.com.
Close every private window, open a new one with DevTools open, and load a page on the first of 2 subdomains of your site. Answer the consent banner there and open the Application tab. Select the site under Cookies, and read the Domain column of the 3 cookies whose names start with cookie_consent_.
Cause 1: cookie_domain is not set
Without cookie_domain, the browser keeps each consent cookie for the one hostname that wrote it, so every other subdomain asks again. These host-only cookies show the full hostname, such as www.example.com, without a leading dot in the Domain column.
A configuration with no cookie_domain on the subdomain where you answered is the cause, because that subdomain wrote the host-only cookies. Add "cookie_domain": "example.com" to the configuration object on every subdomain. The Domain column then shows .example.com, and one answer counts on every subdomain. Set up the shared cookies with Share Consent Across Subdomains.
Cause 2: One subdomain uses a different cookie_domain
A subdomain with another cookie_domain, or none, removes the shared consent cookies when its visitor answers, so the other subdomains ask again. Each Cookie Consent write removes copies of the same cookie that were set for the hostname or a parent domain, except the copy for its own cookie_domain.
The Console tab shows [Cookie Consent] cookie_consent_level is set more than once, probably by subdomains with different cookie_domain settings; use the same cookie_domain on every subdomain when 2 copies exist, with or without debug. Open the configuration on every subdomain, including the blog, the shop, and the help center, and compare the values. Cookie Consent does not support a mix of settings, so set the same cookie_domain on every subdomain.
Cause 3: The domains are not subdomains of one domain
Browsers never share a cookie between 2 separate domains, such as example.com and example.de, so each domain asks for its own answer. No Cookie Consent option changes this, because cookie_domain covers only one domain and its subdomains.
Compare the 2 addresses. A different domain name or a different ending, such as .com and .de, means they are separate domains. Set cookie_domain on each domain for its own subdomains, and read what Cookie Consent does not cover in Limits of Free Cookie Consent: What It Does Not Do.
Cause 4: An old host-only cookie predates cookie_domain
Visitors who answered before you set cookie_domain hold host-only cookies, so the first other subdomain they visit asks them once more. That answer writes the shared cookies, but it removes a host-only copy only on the subdomain where the visitor answers.
On the hostname of the first answer, the Application tab shows 2 cookies of the same name, one with the full hostname and one with .example.com. The Console tab shows the warning about a cookie set more than once. The browser lists the older host-only cookie first, and Cookie Consent reads the first one, so the old answer applies on that hostname.
Your visitors keep the old answer until they save a new answer there from the Preferences Center, or until the old cookie expires. No Cookie Consent option removes the old copies sooner. In your own browser, delete the host-only copies, or test in a new private window after you close every other one.
How to verify that one answer covers every subdomain
A shared setup writes each consent cookie once, for the parent domain, and does not show the consent banner on the second subdomain. Publish your change and clear any page cache first.
- Close every private window, open a new one, open DevTools with F12, and load a page on the first subdomain.
- Click the "I agree" button ("OK" in implied mode), open the Application tab, and confirm that the Domain column of the 3 cookies shows
.example.com. - Open a page on the second subdomain in the same window and confirm that no consent banner appears.
- Open the Console tab and confirm that no
[Cookie Consent]warning reports a cookie set more than once.