Nextjs unable to set cookie after production deployment

   const cookie: string = `access_token=${token}; sameSite=none; secure=true; path=/; domain=.fly.dev`;
   response.setHeader("Set-Cookie", cookie)

Hi!

It seems youre using our domain to set the cookie. Try to make it specific to your app to see if it helps.

Other than that, can you describe a little bit more about your problem?

Hey, I am having a similar issue. Can you expand more on what you mean by

It seems youre using our domain to set the cookie. Try to make it specific to your app to see if it helps.

When running locally, I can see the cookie be sent over network in my browser and then it gets set in the browser. I am sending a http-only cookie. In production deployed to fly.io I see the cookie sent over the browser but it never gets set and because of that I am getting redirected back to /login.

The frontend is served on https://domain-fe.fly.dev and the backend is served at https://domain.fly.dev

The http-only cookie settings are sameSite: ‘None’ and Secure: True.

We are using a Django backend and NextJS FE.

How can I resolve this issue?