Next.js Discord

Discord Forum

how to set cookies received from a diff domain on localhost

Unanswered
astro posted this in #help-forum
Open in Discord
so i have a distrubuted setup with a universal server (hono + better-auth) that is used by my nextjs frontend and hono + trpc backend, my nextjs app also sends cookies to the api, however with the current setup i have to run the auth and api server locally even if im planning to do changes only to the frontend, i tried implementing bearer plugin and it works well when i have to send cookies to a diff domain however on the initial authentication the cookie is sent via Set-Cookie header and is thus not automatically set due to domain mismatch. how can i make it such that i can send/receive cookies from my localhost to hosted servers?

0 Replies