Re: [Cgi-session-user] \t(in cleanup) Can't connect to data source '' because I can't work out
Brought to you by:
sherzodr
|
From: <mim...@gm...> - 2013-07-30 23:41:55
|
Issue resolved by calling flush() before returning the object. Strangely
enough, I have being using the code for over a year without calling flush()
anywhere within the sub and it has always worked until yesterday.
Mimi
On 31 July 2013 00:13, mim...@gm... <mim...@gm...> wrote:
> I have CGI::Session wrapped up in the subroutine below, and this has
> always worked.
>
> sub initialise_session {
>
> # Establish our database connection.
> my $dbh = db_connect();
>
> CGI::Session->name("token");
> #my $session = new CGI::Session('driver:mysql;serializer:storable',
> undef, { Handle => $dbh}) or die CGI::Session->errstr;
>
> # use for purpose of testing only. Above to be used afterwards.
> my $session = new CGI::Session('driver:mysql', undef, { Handle =>
> $dbh}) or die CGI::Session->errstr;
>
> return $session;
> $session->flush();
> $dbh->disconnect();
> }
>
> Since yesterday it started to error and it's no longer able to commit
> session to MySQL.
>
> [Tue Jul 30 04:40:37 2013] [error] [client 192.168.0.90] \t(in cleanup)
> Can't connect to data source '' because I can't work out what driver to use
> (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env
> var is not set) at /usr/local/share/perl5/CGI/Session/Driver/DBI.pm line
> 26, referer: http://localhost/user.html
>
> No changes have been made to the subroutine, so I'm wondering why this
> sudden error. As you can see above, I have called flush() to commit the
> session before the db is connected. I also did the same else where in my
> program, but the error persist.
>
> Any ideas?
>
> Thanks
>
> Mimi
>
|