Cross-Site-Cookies - domain.com & localhost:3000

I have a backend running auth.domain.com

I have another one in development, and I want the development one to redirect to the auth.domain.com to sign-in

The issue is, the session is being stored under domain.com, and I want a way to use that on localhost.

Like how Clerk does it with their pre-build pages. They work for both localhost and any production domain you have.

How can I modify the cookie settings on better auth to store the session in both localhost and domain.com, that way I can be able to test the localhost app using the auth hosted in a production domain.

I was thiking something like
 advanced: {
    crossSubDomainCookies: true,
      domain: ["localhost", "domain.com", "etc.com"],
    },
  },
Was this page helpful?