
MojoX::Session::Store::DBIC - DBIx::Class Store for MojoX::Session

CREATE TABLE session (
sid VARCHAR(40) PRIMARY KEY,
data TEXT,
expires INTEGER UNSIGNED NOT NULL,
UNIQUE(sid)
);
my $schema = DB->connect($dsn, $user, $pass, \%attr);
my $rs = $schema->resultset('Session');
my $session = MojoX::Session->new(
store => MojoX::Session::Store::DBI->new(resultset => $rs),
...
);

MojoX::Session::Store::DBIC is a store for MojoX::Session that stores a session in a database using DBIx::Class.

MojoX::Session::Store::DBIC implements the following attributes.
resultset my $resultset = $store->resultset;
$resultset = $store->resultset(resultset);
Get and set DBIx::Class::ResultSet object.
sid_columnSession id column name. Default is 'sid'.
expires_columnExpires column name. Default is 'expires'.
data_columnData column name. Default is 'data'.

MojoX::Session::Store::DBIC inherits all methods from MojoX::Session::Store.
createInsert session to database.
updateUpdate session in database.
loadLoad session from database.
deleteDelete session from database.

William Ono

Copyright (C) 2008, Viacheslav Tykhanovskyi.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.