NAME

CGI::Session::Driver::redis - CGI::Session driver for redis

SYNOPSIS

    use strict;
    use warnings;
    use Redis;

    my $redis = Redis->new();

    my $session = CGI::Session->new( "driver:redis", $sid, { Redis => $redis,
                                                             Expire => 60*60*24 } );

DESCRIPTION

This backend stores session data in a persistent redis server, with the ability to specify an expiry time in seconds.

DRIVER ARGUMENTS

The following options may be passed to the constructor:

Expiry

Which is the time to expire the sessions, in seconds, in inactivity. Supplying a value of "0" equates to never expiring sessions.

Prefix

A string value to prefix to the session ID prior to redis storage. The default is "session".

Redis

A Redis object which will be used to store the session data within.

REQUIREMENTS

CGI::Session
Redis

AUTHOR

Steve Kemp <steve@steve.org.uk>

COPYRIGHT AND LICENSE

Copyright (C) 2010 Steve Kemp <steve@steve.org.uk>.

This library is free software. You can modify and or distribute it under the same terms as Perl itself.

METHODS

init

Initialise our driver, ensuring we received a 'Redis' attribute.

store

Generate a key, by joining a prefix and the session identifier, then store the session underneath that key.

retrieve

Generate a key, by joining a prefix and the session identifier, then return the session information stored under that key.

retrieve

Generate a key, by joining a prefix and the session identifier, then remove that key from the Redis store.

SEE ALSO