This is a fork of Baachi's work
<?
use Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler;
$sessionTimeout = 60 * 60 * 24 * 7; // 1 week
$redisClient = new \Redis('localhost');
new RedisSessionHandler($redisClient, $sessionTimeout);
This handler supports these options
key_prefix
- set a key prefix
This will allow you to manage your PHP session keys by running key key:prefix:*
.
<?
// Initalization above
$options = array(
'key_prefix' => 'php:ses:'
);
new RedisSessionHandler($redisclient, $sessionTimeout, $options);