Share Cookies Across Subdomains
This guide explains how to share cookie consent settings between your main website and subdomains (e.g., www.example.com and shop.example.com).
The Problem
By default, cookie consent is stored as a host-only cookie, which means:
- If a visitor accepts cookies on
www.example.com, the consent is not recognized onshop.example.com - Users would need to accept cookies separately on each subdomain
- This creates a poor user experience, especially for websites with webshops or other services on subdomains
The Solution
The "Share cookies across subdomains" feature solves this by setting cookies with the parent domain (e.g., .example.com), making them accessible to all subdomains.
How to Enable
- Go to Extensions → Plugins in your Joomla administrator
- Find and open System - Web357 Cookies Policy Notification Bar
- Navigate to the Advanced Settings tab
- Scroll down to the "Share Cookies Across Subdomains" section
- Set "Share cookies across subdomains" to Yes
- Click Save

How It Works
When enabled, the plugin automatically:
- Detects your parent domain (e.g.,
example.comfromwww.example.comorshop.example.com) - Sets all consent cookies with
domain=.example.com - This allows all subdomains to read and write the same consent cookies
Affected Cookies
The following cookies will be shared across subdomains:
cpnb_cookiesSettings- Stores the user's category preferencescpnbCookiesDeclined- Indicates if the user declined cookiescpnbCookiesCancelled- Indicates if the user cancelled the consent dialog- The accept cookie (default:
cookiesDirective)
Requirements
For this feature to work correctly:
- ✅ Both the main site and subdomain must use HTTPS
- ✅ The plugin should be installed on both sites (if applicable)
- ✅ Both installations should have the same setting enabled
- ✅ Clear existing cookies in your browser after enabling this feature for the first time
Common Use Cases
Webshop on Subdomain
Your main website is at www.example.com and your webshop is at shop.example.com. With this feature enabled, customers only need to consent once.
Multi-language Sites
If you have language-specific subdomains like en.example.com, de.example.com, and fr.example.com, consent will carry over between all language versions.
Staging/Development
Share consent between www.example.com and staging.example.com for consistent testing.
Troubleshooting
Cookies still not shared?
- Clear browser cookies - Old host-only cookies may still exist
- Check HTTPS - Both domains must use HTTPS
- Verify the setting - Ensure the setting is enabled and saved
- Check domain detection - The plugin automatically detects the parent domain; complex domain structures (like
shop.co.uk) may need verification
Need to revert?
Simply set the option back to No. New cookies will be created as host-only cookies again. Note that existing shared cookies may persist until they expire or are manually cleared.