Anyone here have any experience using Apache::Session::MySQL ???
I'm 100% stuck. As a test I created the script at the end of this post. All
it does is attach to the server, generate a session key, stick some junk data
on it, and exit. Its all copped from example code. I've tried running it from
the command line, as a CGI and as an Apache::Registry script. No dice. It
connects to the server, inserts a record with a session key and some
serialized data, then exits. All I get is a record with a session key and an
empty string for data. This one has me stumped. Running under DBI_TRACE=2
shows a perfectly valid SQL statement, INCLUDING the serialized session data,
but for some blasted reason its vanished by the time the script exits.
Anyone out there gotten something like this to work? I'd LIKE to be able to
use the XSP::Session taglib, but its pointless if the underlying session
storage mechanism is broken! :(
#! /usr/bin/perl
BEGIN {
print "Content-type: text/html\n\n";
print "doing something<br>\n";
use Apache::Session::MySQL;
};
my %session;
tie %session, 'Apache::Session::MySQL', undef, {
DataSource => 'dbi:mysql:sessions',
UserName => 'root',
Password => $db_pass,
LockDataSource => 'dbi:mysql:sessions',
LockUserName => 'root',
LockPassword => $db_pass
};
#stick some stuff in it
$session{visa_number} = "1234 5678 9876 5432";
#get the session id for later use
my $id = $session{_session_id};
print "got here and ID is $id, 'visa number' is $session{visa_number}\n";
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]