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,
},
})

Go to the GitHub discussion