Ok, I'm nothing near a Perl rookie. That being said here's the issue...
I am currently troubleshooting someone else's script and I have no clue what I'm doing. The problem is that once users login with a correct user/pass, they get taken to the client's main menu. From there they have 2 links that take them to either destination A or destination B. Though when a user gets to the client menu and click on either Dest. A or B they are taken to the main login screen again and are forced to...well, login again.
I know without putting code samples the problem is too vague for immediate diagnosis, I'm more interested in if anyone has experienced a problem similar to this and if it was something well known within CGI community.
My starting point will be to install an apache server w/ mod_perl, but I haven't started researching how to accomplish that task. So that escapade is for later tonight. After that I'm gonna disect the code until more info appears.
Thanks in Advance,
M. Cold
¦-> code start
sub login {
my ($user,$pass) = @_;
my ($q,$res,$status,$cpass);
return(0, 'Invalid username.') unless defined($user);
return(0, '#*$!Invalid password.') unless defined($pass);
# fetch account id if valid user
$q = qq{SELECT id,status,password FROM accounts };
$q .= qq{WHERE username =?};
$res = $QUERY->select($q, [$user]);
unless ( $res->num_rows() ) {
return(0, 'Username not found.');
}
$UID = $res->value(1,1);
$status = $res->value(1,2);
$cpass = $res->value(1,3);
unless (crypt($pass, $cpass) eq $cpass) {
return(0, 'Invalid password.');
}
unless (lc($status) eq 'active') {
return(0, "User '$user' is inactive.");
}
# update session table
$QUERY->update( table => 'sessions',
data => {account_id=>$UID},
where => ['session_id =?', $SID],
);
return(1, undef);
}
#--------------------------------------------
sub logout {
my $session_id;
my $cname = $CONFIG{cookie_key} ¦¦ '_'.$APPNAME.'_';
my $sid = $COOKIES{$cname};
return unless defined($sid);
$QUERY->delete( table => 'sessions',
where => ['session_id =?', $sid],
);
kill_cookie();
}
¦-> code End
Just curious could the session update/delete be causing the slow response time?
Thanks in Advance
Hmmm...don't get it?
>> First check how session tracking implements there. Get or post?
Your are correct, it's GET. No hidden forms exist either.
>> Are you trying to log into another system, too?
Nope, and I'm not sure what a duplicate funtion is...could you explain?
Thank you guys very much
_Milo