Store auth session in cookies instead of localStorage so server-side
code (admin layout, API routes, protected layout) can read the session.
Implements chunked cookie support for large session tokens.
https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
@supabase/ssr uses __dirname internally which crashes in Vercel's Edge
runtime, causing MIDDLEWARE_INVOCATION_FAILED even without a middleware
file. Replaced with @supabase/supabase-js directly:
- Server client: manual cookie-based session restoration
- Browser client: direct createClient from supabase-js
- Admin client: already using supabase-js
https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y