Auth not working across completely different domains (app)
I'm trying to set up authentication where users log in on one domain and use the app on another completely different domain (think
My question: Does Better-Auth tie sessions to the domain where they were created? Even with a shared database, will a session created on
I'm using SvelteKit + Better-Auth + Drizzle + Turso. Has anyone got this working with completely different domains?
All other config are normal or same as installation docs.
I may be missing something very obvious here, help would be really appreciated
Thanks!
auth-service.com and my-app.io - totally unrelated domains).
- Auth server on
a.xyz - Main app on
foo.abc - Both use the same Turso database and identical Better-Auth configs
- Same session table, same cookie names, everything
- User logs in on auth server → works fine, session created in database
- Auth server sends session token back to main app
- Main app sets the token as a cookie on its domain
- When I call
getSession()on the main app → returns null every time
My question: Does Better-Auth tie sessions to the domain where they were created? Even with a shared database, will a session created on
a.xyz never work on foo.abc?I'm using SvelteKit + Better-Auth + Drizzle + Turso. Has anyone got this working with completely different domains?
All other config are normal or same as installation docs.
I may be missing something very obvious here, help would be really appreciated
Thanks!

