Next.js Discord

Discord Forum

nextjs cookies server side

Unanswered
Britannia Petite posted this in #help-forum
Open in Discord
Britannia PetiteOP
hi guys im using nextjs as frontend and adonisjs as backend
im doing my own authentication, but i have a problem, when i try to get my cookie in the nextjs i just can't do it
this code: const getCookies = cookies().getAll()
returns an empty array
but, when i change the domain in the chrome (just for testing) to localhost i can get the cookie, how can i solve that problem?

I would really like someone to help me, I've been stuck with this problem for several days and haven't found a solution

0 Replies