Why does this fail?
I have turned on prompt on cookie in my browser so I know the coookie is being set
Then when I try to check for the cookie in the logedin sub it fails.
I am missing something here, what am I doing wrong???
Thanks :)
my $foo = crypt($password3, $row[0]);
if ($foo ne $row[0]) {
print "Content-type: text/html\n\n";
print "sorry it seems you are unknown to our database";
} else {
set_cookie($username);
}
}
sub set_cookie {
my $cookie = $q->cookie ( name => "login",
value => $username,
path => "/cgi-bin");
print $q->redirect( -url => "http://www.foo.com/cgi-bin/bar/ind
+ex.cgi?page=logedin",
-cookie => $cookie );
}
1;
===================================================
sub logedin {
my $cookie = $q->cookie( -name => "login" );
if (defined $cookie) {
my $tmpl = new HTML::Template( filename => "../templates/main.
+html");
$tmpl->param( username => $cookie );
print "Content-type: text/html\n\n";
print $cookie;
#print $tmpl->output;
} else {
print "Content-type: text/html\n\n";
print "not logged in";
}
}
1;
Imagination is more important then knowledge -Einstein-