Dancer::Session::Redis - Redis backend for Dancer Session Engine
# in the Dancer config.yml: session: 'Redis' redis_session: server: 'redi.example.com:6379' database: 1 expire: 3600 debug: 0 ping: 5 # or in the Dancer application: setting session => 'Redis'; setting redis_session => { server => 'redi.example.com:6379', database => 1, expire => 3600, debug => 0, ping => 5, };
This module is a Redis backend for the session engine of Dancer application. This module is a descendant of Dancer::Session::Abstract.
In order to use this session engine, you have to set up a few settings (in the app or app's configuration file).
session
Set the vaue Redis. Required parameter.
redis_session
Settings for backend.
Hostname and port of redis-server instance which will be used to store session data. This one is required.
Database # to store session data. Optional. Default value is 0.
Session TTL. Optional. Default value is 900 (seconds).
Time (in seconds) to check connection alive and re-establish in case of closed connection. Optional. Default value is 5 (seconds). Redis server close connection after a client is idle for seconds but server instance might be configured to not close client's connection. Check the redis server manual.
Enables debug information to STDERR, including all interactions with the redis-server. Optional. Default value is 0.
Validate settings and creates the initial connection to redis-server.
Creates a new object, runs flush and returns the object.
flush
Writes the session information to the Redis database.
Retrieves session information from the Redis database.
Deletes session information from the Redis database.
Dancer
Dancer::Session
Storable
Redis
redis.io
Anton Gerasimov, <me {at} zyxmasta.com>
Copyright (C) 2012 by Anton Gerasimov
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Dancer::Session::Redis, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Session::Redis
CPAN shell
perl -MCPAN -e shell install Dancer::Session::Redis
For more information on module installation, please visit the detailed CPAN module installation guide.