docs/start/framework/react/guide/authentication-overview.md
Server-Side (Secure)
Client-Side (Public)
Isomorphic (Both)
HTTP-Only Cookies (Recommended)
sameSiteJWT Tokens
Server-Side Sessions
Layout Route Pattern (Recommended)
Component-Level Protection
Data/API Protection (Security Boundary)
Server-Driven State (Recommended)
Context-Based State
Hybrid Approach
Build your own authentication system using TanStack Start's server functions and session management. Start with the Authentication Server Primitives guide — it covers session cookies (HttpOnly/Secure/SameSite/__Host-), session lookup as middleware, OAuth state + PKCE, password-reset enumeration defense, CSRF, rate limiting, and session rotation, with the WRONG/CORRECT patterns that catch the common mistakes.
setResponseHeader, read with getRequestHeaderOpen Source & Community Solutions:
Hosted Services:
Visit WorkOS → | View example →
Visit Clerk → | Sign up free → | View example →
Partner Solutions:
DIY Implementations:
Client-Side Examples:
Partner Solutions:
OSS Solutions:
DIY Implementation:
HttpOnly, Secure, SameSite cookies. Do not store session tokens in localStorage or sessionStorage.beforeLoad for page UX, not as the data boundary..validator() on every server function that accepts input.Implementation Guides:
Foundation Concepts:
Step-by-Step Tutorials: