diff --git a/src/Cm/RedisSession/Handler.php b/src/Cm/RedisSession/Handler.php index 8dc1a02..83aec67 100644 --- a/src/Cm/RedisSession/Handler.php +++ b/src/Cm/RedisSession/Handler.php @@ -310,8 +310,11 @@ public function __construct(ConfigInterface $config, LoggerInterface $logger, $r try { $sentinelClient->auth($pass); } catch (\CredisException $e) { - // Prevent throwing exception if Sentinel has no password set - if($e->getCode() !== 0 || strpos($e->getMessage(),'ERR Client sent AUTH, but no password is set') === false) { + // Prevent throwing exception if Sentinel has no password set (error messages are different between redis 5 and redis 6) + if ($e->getCode() !== 0 || ( + strpos($e->getMessage(), 'ERR Client sent AUTH, but no password is set') === false && + strpos($e->getMessage(), 'ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?') === false) + ) { throw $e; } }