Fetch requests to API endpoints aren't showing the session

Last edited: 1/18/2025

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.


_10
const res = await fetch('http://localhost:3000/contact', {
_10
headers: {
_10
cookie: headers().get('cookie') as string,
_10
},
_10
})