You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tatsuhiko Miyagawa <mi...@edge.co.jp> on 2000/07/20 14:16:13 UTC

Apache::Session::MySQL problem

I'm using Apache::Session 1.51 + mysql 3.22.32 +
mod_perl 1.24 + Apache 1.3.11. They work well except
one problem.

The problem is, if an acquired Session ID (from Cookie)
is not stored in the session database, Apache goes like

> panic: POPSTACK
> Callback called exit.

I know Apache::Session will die "Object does not exist
in the data store" when it can't restore a session from
database. So my script catch that exception with eval
block. 

But panic will happen. why ?


httpd.conf -- 
<Files ~ "\.cgi$">
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
#PerlInitHandler Apache::StatINC
#PerlSetVar StatINCDebug On
PerlModule Apache::DBI
</Files>

sample.cgi --

use strict;
use Apache;
use Apache::Session::MySQL;
use CGI;
use CGI::Cookie;

my $q = new CGI;
my %session;

eval {
    my $r = Apache->request;
    my %cookie = CGI::Cookie->parse($r->header_in('Cookie'));
    my $sid = $cookie{SID}->value;
    
    tie %session, 'Apache::Session::MySQL', $sid, { 
	DataSource 	=> "dbi:mysql(RaiseError=>1):dbname",
	UserName 	=> "user",
	Password 	=> "passwd",
	LockDataSource 	=> "dbi:mysql(RaiseError=>1):dbname",
	LockUserName 	=> "user",
	LockPassword 	=> "passwd",
    };
};

if ($@) {
    print $q->header, $@;
}
....


Any helps?



+-+-+-+-+-+-+-+-+-+-+-
Tatsuhiko Miyagawa <mi...@edge.co.jp>


Re: Apache::Session::MySQL problem

Posted by Tatsuhiko Miyagawa <mi...@edge.co.jp>.
Thu, 20 Jul 2000 14:29:40 -0700 (PDT)
"Jeffrey W. Baker" <jw...@acm.org> wrote:

> > The problem is, if an acquired Session ID (from Cookie)
> > is not stored in the session database, Apache goes like
> > 
> > > panic: POPSTACK
> > > Callback called exit.
> > 
> > I know Apache::Session will die "Object does not exist
> > in the data store" when it can't restore a session from
> > database. So my script catch that exception with eval
> > block. 
> > 
> > But panic will happen. why ?
> 
> Bug in Perl.  Upgrade.


my perl version is 5.005_03 with FreeBSD 4.0.
shoud I update this to perl 5.6.0 ??



+-+-+-+-+-+-+-+-+-+-
Tatsuhiko Miyagawa <mi...@edge.co.jp>


Re: Apache::Session::MySQL problem

Posted by "Jeffrey W. Baker" <jw...@acm.org>.
On Thu, 20 Jul 2000, Tatsuhiko Miyagawa wrote:

> I'm using Apache::Session 1.51 + mysql 3.22.32 +
> mod_perl 1.24 + Apache 1.3.11. They work well except
> one problem.
> 
> The problem is, if an acquired Session ID (from Cookie)
> is not stored in the session database, Apache goes like
> 
> > panic: POPSTACK
> > Callback called exit.
> 
> I know Apache::Session will die "Object does not exist
> in the data store" when it can't restore a session from
> database. So my script catch that exception with eval
> block. 
> 
> But panic will happen. why ?

Bug in Perl.  Upgrade.

-jwb