PDA

Click to See Complete Forum and Search --> : cookie getting and checking help **RESOLVED**


delta770
Mar 11th, 2004, 09:13 PM
i have



use CGI;
$html = new CGI;

my $loggedIn = 0;
my $errMessage;
my $madeCookie;
%cookie = $html->cookie('StreamIt');
if(exists $cookie{name}){
open(SESSION_READ,"<sesIDs.dat");
my $sessions = <SESSION_READ>;
chomp $sessions;
my %sesHash = split /\|/, $sessions;

if($sesHash{$cookie{"username"}} eq $cookie{"id"}){
print $html->header();
print $cookie{"id"}, "DLKJF";
$loggedIn = 1;
%cookieHash = ("username",$cookie{"username"},"id",$cookie{"id"});
$madeCookie = $html->cookie(-name=>"StreamIt",-value=>\%cookieHash,-expires=>'+1h');
}
close SESSION_READ;
}




i am setting this cokie properly, but is that the right way to get it and check it against a file that i have usernames and ids stored it? it doesn't seem to work...

this sesID's file contains stuff like

Selina|8b88ad37b5153702fdfe13b5c41f8993|Alfred|ceec0cdc17b0e17c4135a1ba0c7b5ea0

any ideas what i'm doing wrong??

--770