#How to access cookies inside server function?
1 messages · Page 1 of 1 (latest)
first, remember RSC support is still unstable/experimental in data mode so there's no full comprehensive content about it on docs
now related to your question, there's no function to access them, you will need to use something like AsyncLocalStorage in your HTTP server and use it to pass the parsed cookies from the request to the server functions
basically you will build this yourself, RR is giving you the tools to use the router with RSC but the rest is up to you
once RSC support is added to framework mode there will most likely be a way to do this
Ok I guess I misunderstood, I thought this was fully cooked but still subject to changes
Seems there is also no way to access the raw request/cookies from server components either
you will need a similar solution using AsyncLocalStorage to pass the request to server components
Ok thanks for the explanation, will just wait until this is fully supported