The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dancer::Session::CHI - Sessions stored in a CHI-based cache

VERSION

0.1.0

DESCRIPTION

This module implements a session engine by using the CHI framework.

CONFIGURATION

The Dancer setting session should be set to CHI.

You should specify a session_driver and if that driver needs parameters, then session_params too.

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".

DEPENDENCY

This module depends on both Dancer and CHI.

AUTHOR

Richard Huxton <richard.huxton@gmail.com>

ACKNOWLEDGEMENTS

The structure of this module is mostly cut+paste work from David Precious' Dancer::Session::Storable.

SEE ALSO

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.

COPYRIGHT

This module is copyright (c) 2011 Richard Huxton <richard.huxton@gmail.com>

LICENSE

This module is free software and is released under the same terms as Perl itself.