Catalyst::Plugin::Session::Manager::Storage::CDBI - stores session data with CDBI
use Catalyst qw/Session::Manager/; MyApp->config->{session} = { storage => 'CDBI', session_class => 'MyApp::M::CDBI::Session', id_field => 'id', storage_field => 'storage', expires_field => 'expires', expires => 3600, need_commit => 1, }
This module allows you to handle session with database. At first, you need to prepare the table for sessions.
Here's an example.
create table session ( id varchar(50), storage mediumtext, expires integer, primary key(id) );
And you have to write the class mapped with this table.
package MyApp::M::CDBI::Session; use base qw/MyApp::M::CDBI/; __PACKAGE__->table('session'); __PACKAGE__->columns( Primary => 'id' ); __PACKAGE__->columns( Essential => qw/storage expires/ );
CDBI-subclass mapped with the table stores session-data.
'id' is set by default.
'storage' is set by default.
'expires' is set by default.
3600 is set by default.
When you handle CDBI as AutoCommit-off, set 1. 0 is set by default.
Catalyst
Catalyst::Plugin::Session::Manager
Lyo Kato <lyo.kato@gmail.com>
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::Manager, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Session::Manager
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Session::Manager
For more information on module installation, please visit the detailed CPAN module installation guide.