NAME

Prancer::Session::Store::Database

SYNOPSIS

This module implements a session handler that stores sessions in a database. It creates its own database connection, separate from any existing database connection, to avoid any issues with transactions. It wraps all changes to the database in transactions to ensure consistency.

This configuration expects a database table that looks like this:

CREATE TABLE session (
    id CHAR(72) NOT NULL,
    application VARCHAR DEFALUT '' NOT NULL,
    timeout integer DEFAULT date_part('epoch'::text, now()) NOT NULL,
    data TEXT
);

CREATE UNIQUE INDEX session_uq ON sessions (id, application);
CREATE INDEX session_timeout_ix ON sessions (timeout);

Additional columns may be added as desired but they will not be used by this session handler.

To use this session handler, add this to your configuration file:

session:
    store:
        driver: Prancer::Session::Store::Database::Driver::DriverName
        options:
            table: sessions
            database: test
            username: test
            password: test
            hostname: localhost
            port: 5432
            charset: utf8
            connection_check_threshold: 10
            dsn_extra:
                RaiseError: 0
                PrintError: 1
            on_connect:
                - SET search_path=public
            expiration_timeout: 3600
            autopurge: 0
            autopurge_probability: 0.1
            application: foobar

OPTIONS

COPYRIGHT

Copyright 2014 Paul Lockaby. All rights reserved.

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

SEE ALSO