function RedisSessionHandler::__construct
List of available options:
- prefix: The prefix to use for the keys in order to avoid collision on the Redis server
- ttl: The time to live in seconds.
Throws
\InvalidArgumentException When unsupported client or options are passed
File
-
vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ RedisSessionHandler.php, line 42
Class
- RedisSessionHandler
- Redis based session storage handler based on the Redis class provided by the PHP redis extension.
Namespace
Symfony\Component\HttpFoundation\Session\Storage\HandlerCode
public function __construct(\Redis|Relay|\RedisArray|\RedisCluster|\Predis\ClientInterface $redis, array $options = []) {
if ($diff = array_diff(array_keys($options), [
'prefix',
'ttl',
])) {
throw new \InvalidArgumentException(\sprintf('The following options are not supported "%s".', implode(', ', $diff)));
}
$this->prefix = $options['prefix'] ?? 'sf_s';
$this->ttl = $options['ttl'] ?? null;
}