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 <[EMAIL PROTECTED]>

Reply via email to