Session is set to www domain
How do I fix this? I need the cookie to work for either www.domain.com or the domain.com as well. I know how to do it in normal sessions but don't know how to set this in better auth
2 Replies
in auth.ts (server configuration, not client) under dvanced tab, add crossSubdomainCookies and enable it and as domain pass .domain.com (notice the leading dot). that enables cookie to be shared across all subdomains.
Cookies | Better Auth
Learn how cookies are used in Better Auth.