http://qs1969.pair.com?node_id=1106856

bigup401 has asked for the wisdom of the Perl Monks concerning the following question:

it looks to be sending cookie now, bt the problem is still bring me back to home.pl instead of wel.pl

Location: wel.pl?Set-Cookie: login=root; path=/; expires=Tue, 11-Nov-2014 23:33:34 GMT Date: Tue, 11 Nov 2014 23:31:34 GMT Content-Type: text/html; charset=ISO-8859-1 Content-type: text/html

home.pl my $cg = new CGI; my $cookie = $cg->cookie(-name => 'login', -value => $username, -expires => '+2m', -path => '/'); print $cg->header(); print "Location: wel.pl?"; print $cg->header(-cookie => $cookie); wel.pl my $cg = new CGI; my $cookie = cookie('login'); if ( ! $cookie ) { print $cg->redirect("home.pl"); } elsif($cookie) { continue; }

Original node content restored below by GrandFather

help me to fix this cookie problem! my cookie script i don't see any problem with it bt i cant understand why its not working, when i put the user and press Submit button it reach at wel.pl and redirect me back to home.pl

home.pl my $cookie = $cg->cookie(-name => 'id', -value => $user, -expires => '+2m', -path => '/'); print "Location: wel.pl?"; print $cg->header(-cookie => $cookie); wel.pl my $cookie = $cg->cookie('id'); if ( ! $cookie ) { print $cgi->redirect("home.pl"); } elsif(my $cookie) { continue; #continue to the site if cookie exists }