Auth / foldkit-auth
Refusals
| Request condition | Response |
|---|---|
| No session cookie | Treated as visitor (Option.none()) |
Missing trusted Origin / Sec-Fetch-Site: same-origin (or CSRF header) | 401, The request did not show it came from this application. |
'navigation' on non-GET/HEAD, upgrade, or non-navigate mode | 401, The request did not show it came from this application. |
| Cookie expired, signed out, idle, or revoked | 401, Your session ended. |
| Multiple session cookies on the request | 401, Sign in again. |
x-foldkit-subject differs from the active session | 401, Who is signed in changed. (SUBJECT_CHANGED) |
| Session store error | 500 defect (never falls back to visitor) |
Pages with Referrer-Policy: no-referrer send Origin: null, and same-origin
GETs omit Origin; both pass when Sec-Fetch-Site equals same-origin.
Browsers send Fetch Metadata only over secure contexts (https: and
localhost), so plain http: on remote hosts is refused.
- Long-lived connections:
revalidatere-checks the cookie a live stream or socket opened with. Because Yielded rotates session credentials on renewal, an open socket closes with4401(Your session ended.) after renewal so the client reconnects with the new cookie. - Session idle timeouts:
verifySessionchecks validity without extendingidleTimeout. Call Yielded'srenewSessionwhile the user is active, or sizeidleTimeoutto fit your session lifetime. - Subject header (
x-foldkit-subject): Imported asSUBJECT_HEADERfromfoldkit-auth(browser-safe, no Yielded import). Holds'visitor'or'subject:<key>'. Withoutkey, the resolver compares againstsession.subjectId.