NAME

Web::Session::SQLite - An implementation of Apache::Session

SYNOPSIS

use Web::Session::SQLite;

#if you want Apache::Session to open new DB handles:

tie %hash, 'Web::Session::SQLite', $id, {
   DataSource => 'dbi:Pg:dbname=sessions',
   UserName   => $db_user,
   Password   => $db_pass,
   Commit     => 1
};

#or, if your handles are already opened:

tie %hash, 'Web::Session::SQLite', $id, {
   Handle => $dbh,
   Commit => 1
};

Web::Session function are also available

DESCRIPTION

This module is an implementation of Apache::Session. It uses the SQLite backing store and no locking. See the example, and the documentation for Web::Session::Store::SQLite for more details.

USAGE

The special Apache::Session argument for this module is Commit. You MUST provide the Commit argument, which instructs this module to either commit the transaction when it is finished, or to simply do nothing. This feature is provided so that this module will not have adverse interactions with your local transaction policy, nor your local database handle caching policy. The argument is mandatory in order to make you think about this problem.

searchLt() and searchGt()

searchLt() and searchGt() take the same arguments and return the same data as searchOn(): sessions whose field is lower (or greater) than the given value, which is excluded. The value must be a number (12, -12 or 12.5): otherwise nothing is returned and an error is printed on STDERR. Spaces around the value are ignored.

Fields listed in Index are compared in SQL as integers (cast(field as integer)), other fields in Perl after reading all sessions. Both compare a non-numeric value as 0, or as its numeric prefix, but SQL keeps only an integer prefix: 12.7 is 12 and 1e3 is 1 in SQL, whereas Perl compares 12.7 and 1000. Store integers in indexed fields to get the same results.

Sessions without the field are never returned, whereas the Perl fallback of Lemonldap::NG compares a missing field as 0.

AUTHOR

This module was written by Xavier Guimard <x.guimard@free.fr> using Apache::Session::Postgres from Jeffrey William Baker as example.

Persistent connection

The database connection is kept open between sessions. Set noreuse => 1 to open and close one for each session, see "PERSISTENT DATABASE CONNECTIONS" in Web::Session.

SEE ALSO

Web::Session