™.. CGI::Session::Driver::DBI - Online Linux Manual PageSection : 3
Updated : 2008-07-16
Source : perl v5.10.1
Note : User Contributed Perl Documentation
NAMECGI::Session::Driver::DBI − Base class for native DBI−related CGI::Session drivers
SYNOPSIS require CGI::Session::Driver::DBI;
@ISA = qw( CGI::Session::Driver::DBI );
DESCRIPTIONIn most cases you can create a new DBI-driven CGI::Session driver by simply creating an empty driver file that inherits from CGI::Session::Driver::DBI. That's exactly what sqlite does. The only reason why this class doesn't suit for a valid driver is its name isn't in lowercase. I'm serious!
NOTESCGI::Session::Driver::DBI defines init() method, which makes DBI handle available for drivers in Handle − object attribute regardless of what \*(C`\e%dsn_args\*(C'\fR were used in creating session object. Should your driver require non-standard initialization you have to re-define \fIinit()\fR method in your \fI.pm\fR file, but make sure to set 'Handle' \- object attribute to database handle (returned by \s-1DBI\-\s0>connect(...)) if you wish to inherit any of the methods from CGI::Session::Driver::DBI.
STORAGEBefore you can use any DBI-based session drivers you need to make sure compatible database table is created for CGI::Session to work with. Following command will produce minimal requirements in most SQL databases: CREATE TABLE sessions (
id CHAR(32) NOT NULL PRIMARY KEY,
a_session TEXT NOT NULL
);
Your session table can define additional columns, but the above two are required. Name of the session table is expected to be sessions by default. You may use a different name if you wish. To do this you have to pass TableName as part of your \*(C` \e%dsn_args \*(C'\fR: $s = new CGI::Session('driver:sqlite', undef, {TableName=>'my_sessions'});
$s = new CGI::Session('driver:mysql', undef,
{
TableName=>'my_sessions',
DataSource=>'dbi:mysql:shopping_cart'.
});
To use different column names, change the 'create table' statement, and then simply do this: $s = new CGI::Session('driver:pg', undef,
{
TableName=>'session',
IdColName=>'my_id',
DataColName=>'my_data',
DataSource=>'dbi:pg:dbname=project',
});
or $s = new CGI::Session('driver:pg', undef,
{
TableName=>'session',
IdColName=>'my_id',
DataColName=>'my_data',
Handle=>$dbh,
});
DRIVER ARGUMENTSFollowing driver arguments are supported: DataSource First argument to be passed to DBI−>connect(). If the driver makes the database connection itself, it will also explicitly disconnect from the database when the driver object is DESTROYed. User User privileged to connect to the database defined in \*(C`DataSource\*(C'\fR. Password Password of the User privileged to connect to the database defined in \*(C`DataSource\*(C'\fR Handle An existing DBI database handle object. The handle can be created on demand by providing a code reference as a argument, such as \*(C`<sub{DBI\-\*(C'\fRconnect}>>. This way, the database connection is only created if it actually needed. This can be useful when combined with a framework plugin like CGI::Application::Plugin::Session, which creates a CGI::Session object on demand as well. \*(C`Handle\*(C'\fR will override all the above arguments, if any present. TableName Name of the table session data will be stored in.
LICENSINGFor support and licensing information see CGI::Session 0
Johanes Gumabo
Data Size : 11,455 byte
man-CGI::Session::Driver::DBI.3pmBuild : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 4 / 170,244
Visitor ID : :
Visitor IP : 3.12.153.240 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|CGI::Session::Driver::DBI.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|CGI::Session::Driver::DBI.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|CGI::Session::Driver::DBI.3pm|41|br══─}─══|'br══─}─══
) (htmlprn|149|CGI::Session::Driver::DBI.3pm|41|'br══─}─══ |'br══─}─══
) (rof_nr_x|149|CGI::Session::Driver::DBI.3pm|51/52|\nF|.ie \nF ══─{─══. de IX
) (rof_unit_scale_px|41|CGI::Session::Driver::DBI.3pm|51/52|F|.ie \nF ══─{─══. de IX
) (rof_if|19|CGI::Session::Driver::DBI.3pm|51/52|\nF|.ie \nF ══─{─══. de IX
) (htmlprn|149|CGI::Session::Driver::DBI.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2"
) (parse_manual_page_|249|CGI::Session::Driver::DBI.3pm|57|══─}─══|.══─}─══
) (htmlprn|149|CGI::Session::Driver::DBI.3pm|57|.══─}─══ |.══─}─══
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|145|\*(C`\e%dsn_args\*(C'\fR were used in creating session object. Should your driver require non-standard initialization you have to re-define \fIinit()\fR method in your \fI.pm\fR file, but make sure to set 'Handle' \- object attribute to database handle (returned by \s-1DBI\-\s0>connect(...)) if you wish to inherit any of the methods from CGI::Session::Driver::DBI. |CGI::Session::Driver::DBI defines \fIinit()\fR method, which makes \s-1DBI\s0 handle available for drivers in \fIHandle\fR \- object attribute regardless of what \f(CW\*(C`\e%dsn_args\*(C'\fR were used in creating session object. Should your driver require non-standard initialization you have to re-define \fIinit()\fR method in your \fI.pm\fR file, but make sure to set 'Handle' \- object attribute to database handle (returned by \s-1DBI\-\s0>connect(...)) if you wish to inherit any of the methods from CGI::Session::Driver::DBI.
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|157|\*(C` \e%dsn_args \*(C'\fR: |Your session table can define additional columns, but the above two are required. Name of the session table is expected to be \fIsessions\fR by default. You may use a different name if you wish. To do this you have to pass \fITableName\fR as part of your \f(CW\*(C` \e%dsn_args \*(C'\fR:
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|201|\*(C`DataSource\*(C'\fR. |User privileged to connect to the database defined in \f(CW\*(C`DataSource\*(C'\fR.
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|204|\*(C`DataSource\*(C'\fR |Password of the \fIUser\fR privileged to connect to the database defined in \f(CW\*(C`DataSource\*(C'\fR
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|208|\*(C`>. |by providing a code reference as a argument, such as \f(CW\*(C`>.
) (rof_escape_sequence|91|CGI::Session::Driver::DBI.3pm|213|\*(C`Handle\*(C'\fR will override all the above arguments, if any present. |\&\f(CW\*(C`Handle\*(C'\fR will override all the above arguments, if any present.
)