GX::Session::Store::Database

Module Version: 0.2000_01

NAME

GX::Session::Store::Database - GX::Database-based session store

SYNOPSIS

None.

DESCRIPTION

This module provides the GX::Session::Store::Database class which extends the GX::Session::Store class.

METHODS

Constructor

new

Returns a new GX::Session::Store::Database object.

$store = GX::Session::Store::Database->new( %attributes );
Attributes:
  • database ( GX::Database class or object ) [ required ]

    The database component.

  • serializer ( GX::Serializer object )

    The serializer to use. Defaults to a GX::Serializer::Storable instance.

  • table ( string )

    The name of the database table. Defaults to "sessions".

Returns:
Exceptions:

Public Methods

database

Returns the associated database component instance.

$database = $store->database;
Returns:

serializer

See GX::Session::Store.

table

Returns the name of the database table.

$table = $store->table;
Returns:
  • $table ( string )

USAGE

Database Setup

MySQL

For version 5.1:

CREATE TABLE sessions (
id VARCHAR(32) NOT NULL PRIMARY KEY,
remote_address VARCHAR(39),
started_at INT,
updated_at INT,
expires_at INT,
data BLOB
)

PostgreSQL

For version 8.4:

CREATE TABLE sessions (
id VARCHAR(32) PRIMARY KEY,
remote_address VARCHAR(39),
started_at INTEGER,
updated_at INTEGER,
expires_at INTEGER,
data BYTEA
)

SQLite

For version 3.6:

CREATE TABLE sessions (
id VARCHAR(32) NOT NULL PRIMARY KEY,
remote_address VARCHAR(39),
started_at INTEGER,
updated_at INTEGER,
expires_at INTEGER,
data BLOB
)

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright © 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.