crossSubDomainCookies setup

@Better Auth
my API is staging.api.example.com.
then to handle better-auth api is staging.api.example.com/v1/auth/*
the front end is staging.app.example.com.
how to configure crossSubDomainCookies ?

i have already tried to set this config
baseURL: "staging.api.example.com",
basePath: "/v1/auth",
advanced: {
  defaultCookieAttributes: {
    sameSite: "none",
    secure: true,
    httpOnly: true,
  },
  crossSubDomainCookies: {
    enabled: true,
    domain: "staging.app.example.",
  },
}


but when users log in, doesnt set anything into user's browser cookies
Was this page helpful?