Next.js Discord

Discord Forum

NEXT 14 Problem with cookies and server side components

Unanswered
Dwarf Hotot posted this in #help-forum
Open in Discord
Dwarf HototOP
Hello
So I have a problem with my server cookies session and server-side components. So I want to fetch user information on the server side, for that, I need to send a cookie, that I use normally on client side.
The problem is, that cookies() function does not have access to the cookie that was sent from my backend to the fronted application. What would be the best approach to handle that.
set SameSite to none for cookie? Or maybe fetching user info on server site is the best option? I would prefer cookie information on server components.

Thanks!

1 Reply

American Shorthair
It should have access. Are you calling cookies in layout.jsx? Or in the file context where its required?