Dancer::Session::CHI - Sessions stored in a CHI-based cache
0.1.0
This module implements a session engine by using the CHI framework.
The Dancer setting session should be set to CHI.
CHI
You should specify a session_driver and if that driver needs parameters, then session_params too.
session_driver
session_params
Here is an example configuration:
session: CHI session_driver: FastMmap session_params: { root_dir: '/path/to/cache', cache_size: '1m' }
Or perhaps:
session: CHI session_driver: File session_params: root_dir: "/srv/testapp/cache/file" depth: 2 expires_in: 3600
or, to share via a sub that returns an already-built CHI object reference:
session: CHI session_via: "Dancer::Plugin::Cache::CHI::cache" session_params: these: "get passed to cache()"
Finally, you might want to set in session_params a namespace for the case when you have multiple apps sharing the same cache. Session IDs might collide in this case. See the CHI documentation for details. If unset it defaults to "Dancer::Session::CHI".
namespace
This module depends on both Dancer and CHI.
Richard Huxton <richard.huxton@gmail.com>
The structure of this module is mostly cut+paste work from David Precious' Dancer::Session::Storable.
See Dancer::Session for details about session usage in route handlers, and Dancer for general information on the Dancer web framework. See CHI for details on the CHI framework.
This module is copyright (c) 2011 Richard Huxton <richard.huxton@gmail.com>
This module is free software and is released under the same terms as Perl itself.
To install Dancer::Session::CHI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Session::CHI
CPAN shell
perl -MCPAN -e shell install Dancer::Session::CHI
For more information on module installation, please visit the detailed CPAN module installation guide.