Subdomain Handling

CookieBoss automatically shares consent across subdomains of the same root domain. Subdomains are included free and count as a single domain for billing.

How it works

When a consent script is compiled, CookieBoss extracts the root domain from the site’s domain name and scopes the consent cookie to it. For example:

Site domainCookie scoped to
example.com.example.com
blog.example.com.example.com
shop.example.com.example.com
example.co.uk.example.co.uk
blog.example.co.uk.example.co.uk

By prefixing the cookie domain with a dot (e.g. .example.com), the browser shares the consent cookie across all subdomains automatically. This means a visitor who accepts cookies on example.com will not see the banner again on blog.example.com.

Billing

Subdomains that share the same root domain count as one domain toward your plan’s domain limit. For example, if your plan allows 3 domains:

  • example.com + blog.example.com + shop.example.com = 1 domain slot
  • example.com + other-site.com = 2 domain slots
  • example.co.uk + blog.example.co.uk + another-site.com = 2 domain slots

CookieBoss recognises common multi-part TLDs like .co.uk, .com.au, .co.jp, and many more. The root domain is always extracted correctly regardless of TLD structure.

Multi-part TLDs

CookieBoss includes a curated list of common multi-part TLDs to ensure correct root domain extraction. Supported TLD patterns include:

  • United Kingdom: .co.uk, .org.uk, .me.uk, .ac.uk
  • Australia: .com.au, .net.au, .org.au
  • Japan: .co.jp, .or.jp, .ne.jp
  • Brazil: .com.br, .net.br, .org.br
  • And many more across Asia-Pacific, Europe, Africa, and the Americas.

LocalStorage fallback

In addition to the root-domain-scoped cookie, CookieBoss stores consent in localStorage as a fallback. Note that localStorage is origin-specific, so it is not shared across subdomains. The cookie is the primary consent storage mechanism for cross-subdomain sharing.

No configuration needed

Subdomain handling is fully automatic. When you add a site (e.g. blog.example.com), CookieBoss will:

  1. Scope the consent cookie to .example.com
  2. Count it under the same domain slot as example.com
  3. Share consent state with any other *.example.com subdomains