Z
zorro
Hello,
This is my first crack at perl. I know php very well so I agreed to fix
some bugs on a web site and this is a strange one. The problem is i can
login in explorer but in firefox the login data is lost somewhere along
the way and i'm eventually sent back to login. I've narrowed it down to
this piece of code:
foreach (split(/; /,$ENV{'HTTP_COOKIE'})){
($c,$v) = split(/=/);
if($c eq "mycookiename"){
$v =~ s/([a-fA-F0-9]{2})/pack("C", hex($1))/eg;
if((split(/\|/,$v))[0] ne "NULL"){
($USERname,$USERpass) = split(/\|/,$v);
}
}
}
The first time this code executes, firefox goes all the way into the
innermost if(split), the second time though, it doesn't even go into
foreach. Yet the cookie exists in the firefox cache...
The password is mork123, but displays only mork when I display it in
the innermost if(split) and I wonder if 123 is truncated by the pack
function.
Any ideas what is happening??
This is my first crack at perl. I know php very well so I agreed to fix
some bugs on a web site and this is a strange one. The problem is i can
login in explorer but in firefox the login data is lost somewhere along
the way and i'm eventually sent back to login. I've narrowed it down to
this piece of code:
foreach (split(/; /,$ENV{'HTTP_COOKIE'})){
($c,$v) = split(/=/);
if($c eq "mycookiename"){
$v =~ s/([a-fA-F0-9]{2})/pack("C", hex($1))/eg;
if((split(/\|/,$v))[0] ne "NULL"){
($USERname,$USERpass) = split(/\|/,$v);
}
}
}
The first time this code executes, firefox goes all the way into the
innermost if(split), the second time though, it doesn't even go into
foreach. Yet the cookie exists in the firefox cache...
The password is mork123, but displays only mork when I display it in
the innermost if(split) and I wonder if 123 is truncated by the pack
function.
Any ideas what is happening??