I trying to separate certain pages of my application into next 14.
During the local test, there was a problem with sending cookies.
For React, when I call https://example.com from https://localhost:3000, cookies stored in that domain are automatically stored in my browser and automatically contained in my request.
like this: enter image description here
But this doesn’t work on server components.
How do I get this to work on server components as well?
I tried to get the cookies through cookies.get() and put them in the request, but the cookies I was trying to send didn’t exist. Perhaps the client component can automatically get the cookies in the request domain contained in the browser when making the request. However, the server component doesn’t have access to the browser, so I don’t know how to resolve this.
박성현 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.