Update session settings to work correctly in production environments

Update server configuration to trust proxy in all environments and set sameSite cookie attribute correctly for production deployments.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 205c1f69-ad43-4a96-81d7-44eda03048df
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/I1D3tV4
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sirpiglr 2025-12-21 04:39:03 +00:00
parent edefcf13fd
commit 7ad559ac9c

View file

@ -32,10 +32,10 @@ app.use(
cookie: {
secure: isProduction,
httpOnly: true,
sameSite: isProduction ? "lax" : "lax",
sameSite: "lax",
maxAge: 7 * 24 * 60 * 60 * 1000, // 7 days
},
proxy: !isProduction, // Trust first proxy in dev for Vite
proxy: true, // Always trust proxy (Replit uses reverse proxy in both dev and prod)
})
);