Apache2::WebApp::Plugin::Session::MySQL - Plugin providing session storage


Apache2-WebApp-Plugin-Session-MySQL documentation  | view source Contained in the Apache2-WebApp-Plugin-Session-MySQL distribution.

Index


NAME

Top

Apache2::WebApp::Plugin::Session::MySQL - Plugin providing session storage

SYNOPSIS

Top

  my $obj = $c->plugin('Session')->method( ... );     # Apache2::WebApp::Plugin::Session->method()

    or

  $c->plugin('Session')->method( ... );

DESCRIPTION

Top

Store persistent data in a MySQL database while maintaining a stateful session using web browser cookies.

PREREQUISITES

Top

This package is part of a larger distribution and was NOT intended to be used directly. In order for this plugin to work properly, the following packages must be installed:

  Apache2::WebApp
  Apache2::WebApp::Plugin::Cookie
  Apache2::WebApp::Plugin::DBI
  Apache2::WebApp::Plugin::Session
  Params::Validate

INSTALLATION

Top

From source:

  $ tar xfz Apache2-WebApp-Plugin-Session-MySQL-0.X.X.tar.gz
  $ perl MakeFile.PL PREFIX=~/path/to/custom/dir LIB=~/path/to/custom/lib
  $ make
  $ make test
  $ make install

Perl one liner using CPAN.pm:

  $ perl -MCPAN -e 'install Apache2::WebApp::Plugin::Session::MySQL'

Use of CPAN.pm in interactive mode:

  $ perl -MCPAN -e shell
  cpan> install Apache2::WebApp::Plugin::Session::MySQL
  cpan> quit

Just like the manual installation of Perl modules, the user may need root access during this process to insure write permission is allowed within the installation directory.

REQUIREMENTS

Top

The database table to store session information is auto-generated. Since this is the case, the MySQL users must have CREATE privileges.

In case you want to manually create this table, you can run the following SQL statement on the MySQL command-line:

  CREATE TABLE IF NOT EXISTS sessions (
  id char(32) NOT NULL PRIMARY KEY,
  a_session text;

CONFIGURATION

Top

Unless it already exists, add the following to your projects webapp.conf

  [session]
  storage_type = mysql
  expires = 1h

OBJECT METHODS

Top

Please refer to Apache2::WebApp::Session for method info.

SEE ALSO

Top

Apache2::WebApp, Apache2::WebApp::Plugin, Apache2::WebApp::Plugin::Cookie, Apache2::WebApp::Plugin::DBI, Apache2::WebApp::Plugin::Session, Apache::Session, Apache::Session::MySQL, Apache::Session::Lock::MySQL

AUTHOR

Top

Marc S. Brooks, <mbrooks@cpan.org> - http://mbrooks.info

COPYRIGHT

Top


Apache2-WebApp-Plugin-Session-MySQL documentation  | view source Contained in the Apache2-WebApp-Plugin-Session-MySQL distribution.