jrschumacher/symfony-redis-session-handler

Redis Session Handler Symfony HttpFoundation Component

v1.0.1 2014-02-24 21:06 UTC

This package is not auto-updated.

Last update: 2024-10-26 16:17:59 UTC


README

Build Status

This is a fork of Baachi's work

Use

<?
use Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler;

$sessionTimeout = 60 * 60 * 24 * 7; // 1 week
$redisClient = new \Redis('localhost');

new RedisSessionHandler($redisClient, $sessionTimeout);

Options

This handler supports these options

  • key_prefix - set a 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);