Ever wondered why cookies are not passed correctly to subrequests - e.g. during SSR or when using Nitro/H3? Then this video is for you. Together we have a look how to pass all the important information, including event context and headers to further calls, eliminating different behavior on server and client.
00:00 Intro
00:15 Pass Cookies via API Request?
01:06 Demo App setup
02:05 Creating a "cookies" API endpoint
03:14 Sending cookies to a subrequest on the server side
05:41 Diving into Nitro and h3 internals for event.$fetch
08:53 Do I need to know about it when not using Nitro at all?
09:17 Calling the API from our Nuxt instance via useFetch
11:35 The same but with useAsyncData
11:49 Fixing the issue with useRequestFetch
14:17 Diving into the Nuxt source code
17:23 Wrapping up