Next.js Discord

Discord Forum

Cookies showing up in Insomnia , not in Google Chrome cookie tab

Answered
Ocicat posted this in #help-forum
Open in Discord
OcicatOP
Hi everyone,

I'm running a Next.js 14 project with app router. When testing the sign-in endpoint, I'm getting the auth cookies, as shown in Insomnia, but no cookie shows up in the Google Chrome cookie tab. When I try to expose the cookie, I also get null.

Any ideas of what might be causing the issue?

Thanks in advance!
Answered by Ray
you have to make the request on browser in order to store the cookies to it
View full answer

17 Replies

OcicatOP
Anyone? I'm stuck here. Tried eveything, from setting samesite to lax , to inserting secure, to deleting browsing data, cookies included. Nothing.

Insomnia still shows the cookies. For Chrome, they do not exist
OcicatOP
Yes,
@Ocicat Yes,
could you show a screenshot of it?
OcicatOP
Absolutely. Just give me a sec, pelase
@Ocicat Click to see attachment
how do you make the request on browser?
OcicatOP
I haven't implemented the sign in page, I have the endpoint written, and that's what I'm testing with Insomina.

Maybe I got this terribly wrong, but once I hit thta endpoint those cookies should from then on included in every request, right?
Answer
if you make the request on Insomina, it only store on Insomina
OcicatOP
I say this because that 's what was happening on Wednsday the cookie was being stored, even though I hadn't teh sign in page
*showing in Chrome cookie panel, thta is
and logined with next-auth?
OcicatOP
No, this is the only project. In fcat I had quickly mocked up a sign in page and I noticed the cookie was missing, whereas before it was showing. Earlier this week I manually deleted that cookie, but that shouldn't have changed anything. I have also since cleared all cookies and nothign seems to work.

I will try hitting that endpoint with a quick sign in and see if I get the cookie
OcicatOP
@Ray, I am happy to report the cookie is in!
Gosh, I could have sworn it was there even when I was hitting the endpoint just with Insomnia, but I have to eat crow 😄

Thank you very much for your guidance and time. Have a wonderful day!