Catalyst::Plugin::Session::Defaults - Default values in your session.
use Catalyst qw/ Session Session::Store::Moose Session::State::Cookie Session::Defaults /; __PACKAGE__->config->{session}{defaults} = { likes_moose => 1, };
This plugin lets you add default values to the intiial data that a session will be created with.
You can either go with a hash in the session configuration key defaults, or you can override the default_session_data method to return a hash dynamically.
defaults
default_session_data
This method returns a deep clone of
YourApp->config->{session}{defaults}
or an empty hash if there is no such key.
It will die on bad data.
This method is overridden to provide the hook that calls default_session_data.
Catalyst, Catalyst::Plugin::Session
Yuval Kogman, nothingmuch@woobling.org
nothingmuch@woobling.org
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Plugin::Session::Defaults, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Session::Defaults
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Session::Defaults
For more information on module installation, please visit the detailed CPAN module installation guide.