Re: CGI::Session with MySQL Driver



Subject: CGI::Session with MySQL Driver

* Alexandre Jaquet schrieb:

> Does anyone 've a sample test script I can use.
>
> I've search the web but didn't find something relevant.

Take the one I recently fixed for you in your last thread (look at
<news:3fvvicF9s5ovU1@xxxxxxxxxxxxxx> if you don't remember) as basis.
Change the call of CGI::Session's constructor from

my $session = new CGI::Session( "driver:File", undef,
{Directory => 'C:/sessions'} );

to

my $dbh = DBI->connect( ... ) # create databasehandle
my $session = new CGI::Session( "driver:MySQL", undef,
{ Handle => $dbh} );

Pay attention to the second parameter which should be remain as it
already is in the various situations. Then read the docs to learn how
creating the necessary table in your MySQL database, at

http://search.cpan.org/~sherzodr/CGI-Session-3.95/Session/MySQL.pm

That's all. If you have a specific problem, try to check the docs first
-- perhaps there is already mentioned a solution.

regards,
fabian
.