I copied the code at the wrong time. I have commented that in and out. Also where I set $sid to 0 was for testing also.
I did set the $sid = '12ba7ce0cfeeae8e8a934af6724910e9';
which I copied from the cookie I am interested in and it proceeded to assume I was logged. The calling code just check ne 0 so anything ne 0 would have the same effect
sub ProcessLoginRequest
{
my ($query) = @_;
my $status = 0;
# $sessionname = 'CGISESSID';
# my %cookies = CGI::Cookie->fetch;
# my $sid = $cookies{$sessionname}->value;
my $sid = GetUserSessionCookie();
warn("ProcessLoginRequest Query: '$query'");
warn("ProcessLoginRequest SID from cookie: '$sid'");
#Check if it got valid return from fetch cookie
if ($sid ne 0){
$status = 1;
But later I compare against the stored session ID.
#---------------------------------------------------------------------
+----------
# FUNCTION: OpenSession($dbh, $sid)
# Opens existing session or creates new depending on $sid
#---------------------------------------------------------------------
+----------
sub OpenSession{
my ($dbh, $sid)= @_;
$session = new CGI::Session("driver:MySQL", $sid, {Handle=>$dbh, Lo
+ckHandle=>$dbh});
return $session;
}
Thanks
|