Commit e4abf91
feat: move Symfony sessions to Redis, env-configurable
framework.session.handler_id now reads from SESSION_HANDLER_DSN, which
defaults to the existing REDIS_CACHE_DSN so dev (and prod that has Redis
available) gets Redis-backed sessions out of the box. Operators can set
SESSION_HANDLER_DSN= (empty) to fall back to PHP's native file handler.
Why move:
- Removes the per-session flock that serialises parallel session-touching
requests on the file handler (visible as inconsistent tail latency
when the React admin fires concurrent fetches).
- Sessions survive container restarts without mounting /tmp as a volume.
- Multi-pod deployments share session state without sticky routing —
the OIDC handshake works regardless of which pod handles the callback.
The new RedisSessionHandler is auto-built by Symfony from the DSN; it
prefixes keys with `sf_s` so they don't collide with cache keys on the
same Redis DB. when@test forces handler_id back to null, since
MockFileSessionStorage doesn't go through a handler and we don't want
the test container to compile a Redis handler against an env that may
not point at a reachable Redis.
Verified locally: HTTP request to /v2/authentication/oidc/urls writes a
`sf_s<id>` key into Redis; full PHPUnit suite (143 tests, 607
assertions) passes with redis DBSIZE=0 after, confirming the test
override works.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 665d38c commit e4abf91
3 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
0 commit comments