-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Symfony version(s) affected: 5.2.x
Description
The RedisSessionHandler
allows to set two options: prefix
and ttl
.
Unfortunately, it looks like these settings are not properly based in the calling code:
Instead, only the options ["lazy" => true]
are passed. The options from the DSN are not parsed for setting up the symfony-side of the config (they are only parsed to configure the redis client itself).
How to reproduce
Use the following DSN to configure your session client: redis://localhost:6379?prefix=ohai_
and it will still use the default prefix sf_s
.
The SessionHandlerFactory
uses the redis parsing code from symfony/cache
, so only the connection is set up with these settings and not the session handler itself.
Possible Solution
The only solution I see right now is to parse the query twice: once for setting up the session handler, once for creating the connection.
Additional context
n/a