kagann
BABetter Auth
•Created by kagann on 5/6/2025 in #help
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?
8 replies