Fetch requests to API endpoints aren't showing the session
Last edited: October 13, 2026
You must pass along the cookie header with the fetch request in order for your API endpoint to get access to the cookie from this request.
const res = await fetch('http://localhost:3000/contact', { headers: { cookie: headers().get('cookie') as string, },})Related topics
- Server-side auth
- Creating a Supabase client for SSR
- User sessions
- How do you troubleshoot Next.js and Supabase Auth issues