Replies: 4 comments 8 replies
-
https://nextjs.org/docs/app/api-reference/functions/cookies |
Beta Was this translation helpful? Give feedback.
-
I have same question, have you found any solution yet? |
Beta Was this translation helpful? Give feedback.
-
I found a fix for this. Consider these key points:
export { handler as GET, handler as POST }; Do let me know if this works for you. Happy codding. |
Beta Was this translation helpful? Give feedback.
-
did you get a solution: app\api\trpc[trpc]\route.ts
The above works, but if I try setting the header in the procedure as shown below, it does not work
|
Beta Was this translation helpful? Give feedback.
-
Hi!
I have a Next.js 13 (app router) which uses
fetchRequestHanlder()
.Here's the route handler for demo purposes:
My question is: how can I set a session cookie from the server side?
I tried using
resHeaders.set('Set-Cookie', 'session=somevalue')
as suggested in #4226 , but that didn't seem to work. All I've tried ended up in not working altogether.Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions