Dancer::Session::Redis - Redis backend for Dancer Session Engine
version 0.22
# in the Dancer config.yml:
session: 'Redis'
redis_session:
sock: '/var/run/redis.sock'
password: 'QmG_kZECJAvAcDaWqqSqoNLUka5v3unMe_8sqYMh6ST'
database: 1
expire: 3600
debug: 0
# or in the Dancer application:
setting redis_session => {
server => 'redi.example.com:6379',
password => 'QmG_kZECJAvAcDaWqqSqoNLUka5v3unMe_8sqYMh6ST',
database => 1,
expire => 3600,
debug => 0,
};
setting session => 'Redis';
This module is a Redis backend for the session engine of Dancer application. This module is a descendant of Dancer::Session::Abstract. A simple demo apllication might be found in the eg/
directory of this distribution.
In order to use this session engine, you have to set up a few settings (in the app or app's configuration file).
Set the vaue Redis. Required parameter.
Settings for backend.
Hostname and port of the redis-server instance which will be used to store session data. This one is required unless sock is defined.
unix socket path of the redis-server instance which will be used to store session data.
Password string for redis-server's AUTH command to processing any other commands. Optional. Check the redis-server manual for directive requirepass if you would to use redis internal authentication.
Database # to store session data. Optional. Default value is 0.
Session TTL. Optional. Default value is 900 (seconds).
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.
Returns connection handle to the redis instance. Also establish new connection in case of dead
handle.
Creates a new object, runs flush
and returns the object.
Writes the session information to the Redis database.
Retrieves session information from the Redis database.
Deletes session information from the Redis database.
Please report any bugs or feature requests through the web interface at https://github.com/Wu-Wu/Dancer-Session-Redis/issues
Anton Gerasimov <[email protected]>
This software is copyright (c) 2012 by Anton Gerasimov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.