Creates a new object of type Data::Session::Driver::mysql.
"new()" takes a hash of key/value pairs, some of which might mandatory. Further, some combinations might
be mandatory.
The keys are listed here in alphabetical order.
They are lower-case because they are (also) method names, meaning they can be called to set or get the
value at any time.
o data_col_name => $string
Specifes the name of the column in the sessions table which holds the session data.
This key is normally passed in as Data::Session -> new(data_col_name => $string).
Default: 'a_session'.
This key is optional.
o data_source => $string
Specifies the data source (as used by DBI -> connect($data_source, $username, $password,
$data_source_attr) ) to obtain a database handle.
This key is normally passed in as Data::Session -> new(data_source => $string).
Default: ''.
This key is optional, as long as a value is supplied for 'dbh'.
o data_source_attr => $hashref
Specifies the attributes (as used by DBI -> connect($data_source, $username, $password, $attr) ) to
obtain a database handle.
This key is normally passed in as Data::Session -> new(data_source_attr => $hashref).
Default: {AutoCommit => 1, PrintError => 0, RaiseError => 1}.
This key is optional.
o dbh => $dbh
Specifies the database handle to use to access the sessions table.
This key is normally passed in as Data::Session -> new(dbh => $dbh).
If not specified, this module will use the values of these keys to obtain a database handle:
o data_source
o data_source_attr
o username
o password
Default: ''.
This key is optional.
o host => $string
Specifies the host name to attach to the data_source.
So Data::Session -> new(data_source => 'dbi:mysql:database=test', host => '192.168.100.1') generates
the call $dbh = DBI -> connect('dbi:mysql:database=test;host=192.168.100.1', ...).
o id_col_name => $string
Specifes the name of the column in the sessions table which holds the session id.
This key is normally passed in as Data::Session -> new(id_col_name => $string).
Default: 'id'.
This key is optional.
o password => $string
Specifies the password (as used by DBI -> connect($data_source, $username, $password,
$data_source_attr) ) to obtain a database handle.
This key is normally passed in as Data::Session -> new(password => $string).
Default: ''.
This key is optional.
o port => $string
Specifies the port number to attach to the data_source.
So Data::Session -> new(data_source => 'dbi:mysql:database=test', port => '5000') generates the call
$dbh = DBI -> connect('dbi:mysql:database=test;port=5000', ...).
o socket => $string
Specifies the socket to attach to the data_source.
So Data::Session -> new(data_source => 'dbi:mysql:database=test', socket => '/dev/mysql.sock')
generates the call $dbh = DBI -> connect('dbi:mysql:database=test;mysql_socket=/dev/mysql.sock',
...).
The reason this key is called socket and not mysql_socket is in case other drivers permit a socket
option.
o table_name => $string
Specifes the name of the sessions table.
This key is normally passed in as Data::Session -> new(table_name => $string).
Default: 'sessions'.
This key is optional.
o username => $string
Specifies the username (as used by DBI -> connect($data_source, $username, $password,
$data_source_attr) ) to obtain a database handle.
This key is normally passed in as Data::Session -> new(username => $string).
Default: ''.
This key is optional.
o verbose => $integer
Print to STDERR more or less information.
This key is normally passed in as Data::Session -> new(verbose => $integer).
Typical values are 0, 1 and 2.
This key is optional.