How can i access the cookies when i use Server rendering - NEXTJS 14
I'm trying to pre-fetch some data needed for the layout, I followed the guide on this page: https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr,
I have a setup just like the page mentioned above using the NextJS app router. however, I need to access the server state to get some data from the cookies to send the request, which I cannot get in a client component.
I can get the cookies in the server component, but not downstream in the client components.
I've tried many things but still nothing seems to work.
2 Replies
genetic-orange•17mo ago
Is your cookie http only? You can't access from JS side if that's the case
fascinating-indigo•17mo ago
i dont wanna be a douche
but seems like not a query question
im looking into it though
ahhh nvm it is
lol
isnt it possible to pass it down
?
something like this?