Enrico,
If I do migrate to Apache::SessionManager will this problem disappear? I
started looking into the transformation and it appears as if it will be a
good bit of work to accomplish the entire cutover and I just want to make
for sure that it's not something I'd have to build into my app anyway.
The reason I ask is because I was having some trouble with the
configuration? After putting the following into the httpd.conf file
## BEGIN CONFIGURATION
PerlRequire /usr/local/apache/conf/startup.pl
PerlWarn On
PerlFreshRestart On
PerlModule Apache::SessionManager
PerlTransHandler Apache::SessionManager
Alias /perl /usr/local/apache/cgi-bin
<Location /perl>
SetHandler perl-script
PerlSendHeader On
PerlHandler Apache::Registry
PerlSetVar SessionManagerTracking On
PerlSetVar SessionManagerExpire 120
PerlSetVar SessionManagerInactivity 900
PerlSetVar SessionManagerName SESSION_ID
PerlSetVar SessionManagerStore File
PerlSetVar SessionManagerStoreArgs "Directory => /tmp/sessions"
PerlSetVar SessionManagerDebug 0
Options ExecCGI
allow from all
</Location>
and using the code........
## BEGIN CODE
sub validate {
my $r=shift;
my $cgi=new CGI;
my $session = Apache::SessionManager::get_session($r);
if (($$session{logged_in} eq "Y")){
return $session;
}else{
print $cgi->redirect('http://' . $ENV{HTTP_HOST} .
'/perl/sess.cgi');
return $session;
}
}
I always get the error:
Can't locate object method "pnotes" via package "<package_name>" at
/usr/local/lib/perl5/site_perl/5.8.0/Apache/SessionManager.pm line 202,
<TheFile> line 28.
I'm sure I'm going about something wrong, but I seem to have hit a
roadblock.....do I need to write my own handler for this?
thnx,
~j
----- Original Message -----
From: "Enrico Sorcinelli" <[EMAIL PROTECTED]>
To: "Jason Jolly" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 1:52 AM
Subject: Re: cookie setting/retieval
> On Mon, 31 Mar 2003 18:11:21 -0600
> "Jason Jolly" <[EMAIL PROTECTED]> wrote:
>
> > I'm currently in the process of writing a wrapper for a site using
Apache::Session and mod_perl. I was having great success using the
following code to either validate a cookie which was already present or set
a new cookie if necessary:
>
> Hi Jason,
> don't reinvent the wheel! ;-)
> There's already an Apache::Session wrapper on CPAN called
Apache::SessionManager.
> Apache::SessionManager is a mod_perl module that helps session management
of a
> web application. It creates a session object and makes it available to all
> other handlers transparenlty. Also session expiration policies are
available.
>
> http://cpan.org/modules/by-module/Apache/Apache-SessionManager-0.04.tar.gz
>
> See perldoc Apache::SessionManager for more infos.
>
> by
>
> - Enrico
>