This module implements Dancer 2 session engine based on Sereal files.
This backend can be used in single-machine production environments, but two things should be kept in mind: The content of the session files is not encrypted or protected in anyway and old session files should be purged by a CRON job.
The setting session should be set to Sereal in order to use this session engine in a Dancer2 application.
Sereal
Files will be stored to the value of the setting session_dir, whose default value is appdir/sessions.
session_dir
appdir/sessions
Arguments for the Sereal::Encoder and Sereal::Decoder objects can be given via the encoder_args and decoder_args. If not provided, they default to snappy => 1, croak_on_bless =>1 and refuse_objects => 1, validate_utf8 => 1, respectively.
encoder_args
decoder_args
snappy => 1, croak_on_bless =>1
refuse_objects => 1, validate_utf8 => 1
Here is an example configuration that use this session engine and stores session files in /tmp/dancer-sessions
session: "Sereal" engines: session: Sereal: session_dir: "/tmp/dancer-sessions" encoder_args: snappy: 1 croak_on_bless: 1 decoder_args: refuse_objects: 1 validate_utf8: 1
To install Dancer2::Session::Sereal, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Session::Sereal
CPAN shell
perl -MCPAN -e shell install Dancer2::Session::Sereal
For more information on module installation, please visit the detailed CPAN module installation guide.