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

NAME

Catalyst::Plugin::Session::Manager::Storage::CDBI - stores session data with CDBI

SYNOPSIS

    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,
    }

DESCRIPTION

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/ );

CONFIGURATION

session_class

CDBI-subclass mapped with the table stores session-data.

id_field

'id' is set by default.

storage_field

'storage' is set by default.

expires_field

'expires' is set by default.

expires

3600 is set by default.

need_commit

When you handle CDBI as AutoCommit-off, set 1. 0 is set by default.

SEE ALSO

Catalyst

Catalyst::Plugin::Session::Manager

AUTHOR

Lyo Kato <lyo.kato@gmail.com>

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.