Session Not Persisting in Production (Docker) After Social Login
Hi,
The authentication flow using better-auth and social login works perfectly on localhost. When I log in with a social account, the session is correctly created in the database, and the user appears as logged in on the site.
However, when I run the same setup in production inside Docker, the session is still created in the database, but the user does not appear as logged in on the website. It's like the session is not being recognized properly in production.
Could you help me understand what might be causing this issue in the production environment? Maybe it's related to cookies, domain, or some misconfiguration in Docker?
4 Replies
Hey I'm going to close this as it's solved, right?
If you did solve the issue, please let me know what the issue was.
check the cookie domain
if your backend and client is different
its needs to be like .domain.com
or yourbackendsub.domain.com
I see. BASE URL issue?