Accessing cookies of incoming requests
Answered
California pilchard posted this in #help-forum
California pilchardOP
Hello, I have a nextjs 13 application and I want to access cookie that comes with every request. I am not able to figure out how to do that. Help is appreciated
Answered by fuma
If you're using App Router: https://nextjs.org/docs/app/api-reference/functions/cookies
9 Replies
In where? A page/server component, or middleware
California pilchardOP
in the page
If you're using App Router: https://nextjs.org/docs/app/api-reference/functions/cookies
Answer
California pilchardOP
my backend is redirecting to a page with cookies (access token set)
will try
I am basically implementing Discord's oauth 2.0
I usually recommend redirect users to an GET Router handler, because you can access cookies easier there
California pilchardOP
thanks