Commit c99ab5a
senatorsagent
fix(session): honor x-forwarded-proto / NODE_ENV for cookie secure flag (#25)
Same fix already applied to `middleware.ts` in PR #22 — the session cookie had the same bug: it only looked at `APP_BASE_URL.startsWith('https://')`, which breaks behind TLS-terminating proxies (Vercel/Cloudflare/Railway/nginx). Detect `x-forwarded-proto` and treat `NODE_ENV=production` as secure, matching the middleware cookie behavior.1 parent 7c1c5df commit c99ab5a
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
0 commit comments