juudd serves customer sites from a different registrable domain than the one the panel and the sign-in live on. A site you deploy is never reachable at a host under the control-plane domain, and that is a rule, not a preference. If a customer site ever ran under the domain the session cookie is scoped to, the platform's session would travel to code the customer wrote.
That is the decision. The rest of this post is the cookie that forced it, the second problem the separate domain closes, and what the rule does not do.
One cookie, several hosts
The panel and the API it talks to are separate hosts under our main domain. For the panel to sign you in on one and call the other, the session cookie has to be valid on both, so it is issued scoped to the control-plane domain rather than to a single host.
It is still HttpOnly, Secure and SameSite=Lax, so a script on a page cannot read it and a request from another site does not carry it. Scoping it to a domain changes one thing: the browser attaches it to every host under that domain.
What a wider cookie reaches
Every deployed site can have server-side functions, and those are code the customer or their assistant wrote. If a site were served from a subdomain of the control-plane domain, a visitor's browser would attach the session cookie to that request, and the function would receive it.
Nothing about that needs an attack. It needs only a site, a visitor who happens to be signed in to the panel, and a host name that sits under the wrong domain. The session is then in the request headers of someone else's code, on every request, forever.
So the serving domain is not a subdomain of anything the cookie covers. It is a second registrable domain, used for customer sites and nothing else. A site is served at its id on that domain, and the sign-in cookie is never attached to a request that reaches it.
The second problem is writing, not reading
The first version of this argument said the separate domain was needed so the cookie could not be read. That overstated it. A cookie issued by one host with no domain attribute is never sent to another host at all, and the panel works with exactly that. Customer sites under the control-plane domain would have been survivable, at the price of never getting that attribute wrong.
The separate domain earns its place on the other direction. A host a customer controls under our main domain could set a cookie scoped to the whole domain. The browser would then send it to the API, shadowing the real session instead of reading it. That is the related-domain problem, and it is the road to session fixation.
Defending against it on one domain takes three things that all have to stay right: a host-only cookie, a prefix that forbids a domain scope, and a token on each request that proves where it came from. A second registrable domain closes it by construction. There is nothing to keep right, because a customer host is not under our domain to begin with.
Where the rule is written
The cookie code says it in the comment above the setting: it is safe only because customer sites are on a different registrable domain. The configuration says it beside the setting that scopes the cookie: never set it to a domain that also serves customer sites. Leave the setting empty and the cookie stays host-only, which is what a single-host deployment wants.
That is a rule written in two places, not a check the process runs. Nothing at startup compares the cookie's domain with the serving domain and refuses to boot. If the two were ever pointed at the same domain, the first thing to notice would be a person reading that comment. ADR-0019 says what has to happen if the arrangement ever changes: the cookie goes back to host-only in the same change, not afterwards.
Allowed origins, in one place
Splitting the panel onto its own origin introduced a second thing that can be got wrong: which pages may call the API with the cookie attached. The answer is an allowlist of exact origins, with credentials, in one shared file.
It is never a wildcard, because a browser refuses a wildcard on a request that carries credentials, and the thing people reach for next, echoing whatever origin was sent, fails silently where a wildcard fails loudly. The response also says it varies by origin, so a shared cache cannot hand one origin's answer to another. A service that needs a different answer is a service that should be explaining why in a written decision.
What this costs
- Two domains to hold. One carries the brand, the panel, the connector address and the docs. The other carries customer sites. The second exists only for this and for nothing a visitor ever reads about us.
- A site on a customer's own domain is a different case. That address is the customer's, not ours, so it is not under the control-plane domain either, and the rule is unchanged.
- The rule has no enforcement beyond being written down. See above. It is the weakest part of the arrangement and we would rather say so here than let this post read as stronger than the code.
The rule, once
A customer site is never served from the control-plane domain or any host under it, because the session cookie reaches every host under the domain it is scoped to and a customer host under that domain could write one. Every tool and what it refuses is listed in the docs.