Browsers that logged in before the session cookie became Domain-scoped
still hold the old host-only descrybe_session for api.descrybe.io. They
then send BOTH cookies — older (stale) first — and Go reads the first
match, so the stale relic shadows the fresh Domain cookie and every
request 401s even immediately after a successful login. Clearing
browser cookies fixed it manually; users should never have to.
New DedupeSessionCookies middleware (mounted before scs LoadAndSave):
when duplicate session cookies arrive, pick the token that resolves in
the session store, rewrite the Cookie header to just that one, expire
the host-only relic (Set-Cookie without Domain only touches the
host-only variant), and re-issue the surviving token on the canonical
Domain cookie. One request converges the browser to a single cookie.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Production splits web (descrybe.io) and API (api.descrybe.io). The session
cookie was host-only for api.descrybe.io, so the browser never sent it to
the web host. The /admin SvelteKit SSR gate (fetchMeStaff in
+layout.server.ts) forwards the incoming cookie header to /api/auth/me —
with no cookie to forward it always got 401 and bounced every successful
login back to /login?next=/admin (login POST 200, /me 200 from the
browser, /me 401 from the web server).
New SESSION_COOKIE_DOMAIN env (default empty = host-only, local dev
unchanged) sets the session cookie Domain attribute; set it to the parent
domain (descrybe.io) in production so both hosts receive the cookie.
Leading dot is normalized away. CSRF needs no change — it already seeds
cross-origin via the X-CSRF-Token response header.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Category enhance prompts (Sync A1 / seed-a1 / repair) now use the same
three role sections as the rest of the platform: Title / Description /
Meta. The retired "--- Attributes ---" role section is removed from the
canonical template, the legacy-split overlay, and the web prompt editor;
Category/Attrs stay as plain product-context lines (attribute extraction
remains pipeline-level via AppendAttributeConstraints).
- Stored prompts still carrying an attributes section are detected by
CategoryEnhancePromptNeedsRepair and rewritten on the next Sync.
- Legacy wp_product_categories.sql splits now also seed a default Slovenian
metaTitle rule (dumps only carried <metaDescription>), so every A1
category gets all four prompt areas: title formula, description
sections, meta title, meta description.
- Role-sectioned prompts no longer imply the A1 SEO-omit cohort
(CompanyOmitsSEOMeta): sectioned prompts are the canonical prompt-editor
output for every tenant, and the sniff silently disabled SEO meta for
any company that saved a category prompt.
- Verified locally: repair-category-prompts -apply updated 238 A1 +
Platform Demo categories from scripts/seed/wp_product_categories.sql
(216 legacy splits), idempotent on re-run, zero attributes sections
left in DB.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>