JESii has asked for the wisdom of the Perl Monks concerning the following question:
I'm using CGI::Application and just added CGI::Session for session handling. Now I get the error message:
Error executing run mode 'login_process': Can't locate auto/CGI/Session/File/expired.al in @INC.
@INC contains:
/usr/local/lib/perl5/5.8.2/i386-freebsd /usr/local/lib/perl5/5.8.2 /usr/local/lib/perl5/site_perl/5.8.2/i386-freebsd /usr/local/lib/perl5/site_perl/5.8.2 /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl
The relevant code snippets follow: the cgiapp_prerun method where I get the session and check to see if the user is logged in. If they are not logged in, then I divert them to the 'login_form', and then the error is generated when I try to switch modes.
### Pre-runmode method sub cgiapp_prerun { my $self = shift; my $next_mode = shift; my $q = $self->query(); $self->_get_session(); ### If a login/help runmode, then you're finished... if ($next_mode =~ m/^help_/ || $next_mode =~ m/^login_/ || $next_mode =~ m/^splash_screen_/ ) { return; } ### All other runmodes require that you be logged in... unless ($Session->param("_Is-Logged_In")) { ### Save current runmode and passed parameters so that we can +re-invoke it after ### the user gets logged in... $Session->save_param($q); $Session->param("Logged-In-Runmode", $next_mode); $self->prerun_mode("login_form"); } return; } ### Get a session for this invocation sub _get_session { my $self = shift; my $q = $self->query(); $Session = new CGI::Session(undef, $q, {Directory=>"/tmp"}), unles +s ($Session); $SessionID = $Session->id(); if ($Session->is_new() ) { $Session->expire('+1y'); my $cookie = $q->cookie(-name => "CGISESSID", -value => $SessionID, -expires => '+1y'); $self->header_props(-cookie => $cookie); } }
When I do a find, the "expired.al" file is not found. However, find does locate the following files:
/usr/local/lib/perl5/site_perl/5.8.2/auto/CGI/Session/expire.al /usr/local/lib/perl5/site_perl/5.8.2/auto/CGI/Session/expires.al
I've checked CPAN (perl -MCPAN ...) and I have the latest version (3.95). Just to make sure, I downloaded it again and forced an install.
Curiously, when I ask the CPAN module to check for reinstall recommendations, the CGI::Session module isn't listed ("72 installed modules have no parseable version number"), but when I look at the CGI::Session code, there's a version number there:
use vars qw($VERSION $REVISION $errstr $IP_MATCH $NAME $API_3 $FROZEN) +; ($REVISION) = '$Revision: 3.12.2.7.2.4 $' =~ m/Revision:\s*(\S+)/; $VERSION = '3.95'; $NAME = 'CGISESSID';
I've checked the various docs/lists but can't find anything... I hope you have some suggestions for me.
Thanks...jon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Session autoload failure
by antirice (Priest) on Jan 09, 2004 at 19:06 UTC | |
by JESii (Novice) on Jan 11, 2004 at 00:18 UTC | |
|
Re: CGI::Session autoload failure
by cees (Curate) on Jan 09, 2004 at 18:51 UTC | |
by JESii (Novice) on Jan 10, 2004 at 00:23 UTC |