On this page
What this issue is
A cookie is a small piece of data the browser stores and sends back to your site. If the server sets a cookie without a Domain attribute, it is a *host-only* cookie. The browser sends it only to the exact hostname that set it.
Why it costs you leads or sales
- Ad clickLands on www.example.com
- Log inSession cookie set for www only
- Move to app. subdomainCookie not sent, user looks logged out
- Checkout or bookingVisitor must log in again or leaves
The visitor logs in on www, then moves to a subdomain that cannot see the cookie.
The page on the second subdomain loads, but it cannot read the session and shows a login wall.
How to check if your site has it
Log in on the first subdomain
Use a private window so old cookies do not interfere.
Open developer toolsChrome
In Chrome, press F12, go to Application, then Cookies, and select your site.
Read the Domain column
If it shows www.example.com (no leading dot), the cookie is host-only. If it shows .example.com, subdomains can use it.
Click through to the other subdomain
Follow a real link, such as Buy now or My account. Check whether you are still logged in and whether the cart is intact.
Compare cookies on both hosts
Note which session, cart, visitor ID and consent cookies exist on one host but not the other.
How to fix it
Set the cookie domain in wp-config.php
Add define('COOKIEDOMAIN', '.example.com'); above the line that says to stop editing. Everyone is logged out once, then the login cookie covers subdomains. On multisite, check your existing COOKIE_DOMAIN setting first.
Check plugins
Cart and membership plugins may set their own cookies. Look in their settings for a cookie domain option.
Keep the journey on one domain where possible
Shopify sets its cart and checkout cookies itself and you cannot change their Domain. Use the same primary domain for the store and checkout in Settings, then Domains.
Link to the right host
Make sure links from any other subdomain point to your primary domain, not the myshopify.com address.
Set the cookie domain on your Google tag
In the Google tag, under Configuration settings, add cookie_domain with the value auto or your parent domain so analytics cookies are shared across subdomains.
Check what sets the login
Webflow's own pages do not log visitors in across hosts. If a membership or app tool sets the cookie, change its cookie domain in that tool.
Keep links on the same domain
Where possible, host the pages that need the session under the same parent domain.
Use one custom domain for the funnel
Keep funnel, membership and booking pages on the same connected domain, in Settings, then Domains. GoHighLevel sets its own cookies, so you cannot edit their Domain.
Avoid splitting login across hosts
Wix member login cookies are managed by Wix. Keep member areas on the primary connected domain rather than a separate subdomain.
Keep members and checkout on the primary domain
Squarespace controls its cookies. Set your primary domain in Settings, then Domains, and link to it consistently.
Set the Domain attribute when you set the cookie
Send Domain=example.com (with Path=/, Secure and HttpOnly) in the Set-Cookie header, or the equivalent option in your framework.
Use a shared session store
Each app must read the same session store or signed token, otherwise it cannot recognise the cookie.
Set-Cookie: session=abc123; Domain=example.com; Path=/; Secure; HttpOnly; SameSite=Laxapp.use(session({
secret: process.env.SESSION_SECRET,
cookie: {
domain: '.example.com',
secure: true,
httpOnly: true,
sameSite: 'lax'
}
}));Host-only cookie
- No Domain attribute
- Sent only to www.example.com
- app. subdomain shows a login wall
Parent-domain cookie
- Domain=example.com
- Sent to www, app and checkout
- Visitor stays logged in
How to confirm it's fixed
- Log out fully, clear cookies, and log in again in a private window
- In Application, then Cookies, the session cookie shows a Domain with a leading dot (.example.com)
- Click through to every subdomain in the journey and stay logged in
- The cart contents match after the hop
- Test in Chrome, Safari and Firefox, and on mobile
- Analytics shows one session and the original campaign source across both hosts
How to prevent it happening again
Host-only cookie
Leads or data lost
The visitor moves to the second subdomain and is shown a login screen or an empty cart. Many leave.
Switch the cause on to see what the visitor sees after crossing subdomains.
How FunnelGuard handles this
Questions people ask
Why does my user get logged out when they go from www to a subdomain?
The session cookie was probably set without a Domain attribute, so it is host-only. The browser then sends it only to the exact hostname that created it. Set Domain to your parent domain, such as .example.com, to share it.
How do I share cookies between subdomains?
Set the cookie's Domain attribute to the parent domain, for example Domain=example.com, when the cookie is created. Every subdomain must also read the same session store or token. Test the journey after the change.
Can I share cookies between two different domains?
No. Cookies only work within one registrable domain and its subdomains. For different domains you need another approach, such as passing a signed token in the URL or using a shared login service.
Does a leading dot in the cookie domain matter?
In current browsers, Domain=example.com and Domain=.example.com both apply to subdomains. DevTools often shows the leading dot for cookies that are shared. A host-only cookie shows the exact hostname with no dot.
Why is my cart empty on the checkout subdomain?
The cart is often stored in a cookie or a session tied to the first hostname. If the checkout subdomain cannot read that cookie, it starts a new empty cart. Share the cookie domain and the session store between both hosts.
Can SameSite settings cause logouts between subdomains?
Subdomains of the same site count as same-site, so SameSite=Lax rarely blocks them. Problems are more likely with embedded pages or different domains. Still check Secure, Path and cookie size if the Domain looks right.
Does FunnelGuard detect cookie domain problems?
No. FunnelGuard does not check cookie domains yet; it is a possible future check. It does run your real journeys and reports a failed step with a screenshot, which can show the effect but not the cause.
Related issues
- CNV-361Handoff to checkout/booking domain loses UTMsFix guide
- CNV-362Cross-domain linker (_gl) missingFix guide
- CNV-363Return URL from payment provider brokenFix guide
- CNV-366Funnel builder custom domain disconnectedFix guide
- CNV-367Mixed brand domain confuses users (phishing look)Fix guide
- CNV-365Third-party domain SSL invalidFix guide