Plack::Session::Store::RedisFast - Redis session store.
Default implementation of Redis handle is Redis::Fast; otherwise Redis.
May be overriden through "redis" param.
Default implementation of serializer handle is JSON::XS; otherwise Mojo::JSON or JSON.
May be overriden through "inflate" and "deflate" param.
use Plack::Builder; use Plack::Session::Store::RedisFast; my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ]; }; builder { enable 'Session', store => Plack::Session::Store::RedisFast->new; $app; };
This will persist session data using Redis::Fast or Redis.
This is a subclass of Plack::Session::Store and implements its full interface.
Plack::Session::Store::RedisFast->new( %param );
Parameters:
A simple accessor for the Redis handle.
A simple serializer, requires "deflate" param.
A simple deserializer, requires "inflate" param.
A simple encoder (encode/decode implementation), class or instance. JSON/utf8 by default.
A prefix for Redis session ids. 'Plack::Session::Store::RedisFast:' by default.
An expires for Redis sessions. "ONE_MONTH" in Time::Seconds by default.
$store->each_session(sub { my ( $redis_instance, $redis_prefix, $session_id, $session ) = @_; });
Enumerates all stored sessions using SCAN, see https://redis.io/commands/scan for limitations.
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please fill in GitHub issues.
Akzhan Abdulin <akzhan.abdulin@gmail.com>
Copyright 2017- Akzhan Abdulin
MIT License
To install Plack::Session::Store::RedisFast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Session::Store::RedisFast
CPAN shell
perl -MCPAN -e shell install Plack::Session::Store::RedisFast
For more information on module installation, please visit the detailed CPAN module installation guide.