Can't read cookie from the api route.ts #75276
-
I am using Next.js 14th. Whyle visiting the goods page... App -> goods - page.ts I am using a function that returns cookies.
here is the function:
At this stage everything works properly. Additionaly on the client side I am making the request to the /api/goods/categories. App -> api -> goods -> categories -> route.ts This endpoint uses the same fucntion but the result is "null". always. the Request object is empty.
I see the cookies at the step when making request in the dev tools. But then they disappear. I tried:
Would appriciate any suggestion how to set up the fetch or cookies().set() to make it work properly. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I is my fault. |
Beta Was this translation helpful? Give feedback.
I is my fault.
I tried to make api call from the server component.
What a shame)