CGI::Session::Driver::oracle - A CGI::Session driver for Oracle
CGI::Session::Driver::oracle
$s = CGI::Session -> new('driver:Oracle', $sid); $s = CGI::Session -> new('driver:Oracle', $sid, { DataSource => 'dbi:Oracle:test', User => 'sherzodr', Password => 'hello', }); $s = CGI::Session -> new('driver:Oracle', $sid, {Handle => $dbh});
or
$s = new CGI::Session('driver:Oracle', undef, { TableName=>'session', IdColName=>'my_id', DataColName=>'my_data', Handle=>$dbh, });
CGI::Session::Driver::oracle stores session records in an Oracle table. For details see CGI::Session::Driver::DBI, its parent class.
The CGI::Session::Driver::oracle driver supports all the arguments documented in CGI::Session::Driver::DBI. In addition, the DataSource argument can optionally leave the leading "dbi:Oracle:" string out:
$s = CGI::Session -> new('driver:Oracle', $sid, {DataSource => 'shopping_cart'}); # is the same as: $s = CGI::Session -> new('driver:Oracle', $sid, {DataSource => 'dbi:Oracle:shopping_cart'});
For backwards compatibility, you can also set the table like this before calling new(). However, it is not recommended because it can cause conflicts in a persistent environment.
new()
$CGI::Session::Oracle::TABLE_NAME = 'my_sessions';
sessions
The CGI::Session::DBI docs recommend using this SQL create statement:
CGI::Session::DBI
create table sessions ( id char(32) not null unique, a_session text not null );
Under Oracle, change the column type of the a_session column from text to long, and if you use Class::DBI::Loader, which wants a primary key in every table, change the definition of your id column too. Thus you want:
a_session
text
long
Class::DBI::Loader
id
create table sessions ( id char(32) not null primary key, # I.e.: 'unique' => 'primary key'. a_session long not null # I.e.: 'text' => 'long'. );
This module is available both as a Unix-style distro (*.tgz) and an ActiveState-style distro (*.ppd). The latter is shipped in a *.zip file.
See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing each type of distro.
This code is partially copied from the corresponding MySql driver by Sherzod Ruzmetov and the Postgres driver by Cosimo Streppone.
CGI::Session::Driver::oracle was written by Ron Savage <ron@savage.net.au> in 2005.
Home page: http://savage.net.au/index.html
Australian copyright (c) 2005, Ron Savage. All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html
To install CGI::Session::Driver::oracle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Session::Driver::oracle
CPAN shell
perl -MCPAN -e shell install CGI::Session::Driver::oracle
For more information on module installation, please visit the detailed CPAN module installation guide.