in reply to Re^3: cookie problem
in thread cookie problem

i have tried other way bt still failed 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 $cg = new CGI; my $cookie = $cg->cookie(-name => 'id', -value => $user, -expires => '+2m', -path => '/'); print $cg->redirect("wel.pl"); print $cg->header(-cookie => $cookie); wel.pl my $cookie = $cg->cookie('id'); if ( ! $cookie ) { print $cg->redirect("home.pl"); } elsif($cookie) { #continue to the site if cookie exists }

Replies are listed 'Best First'.
Re^5: cookie problem
by poj (Abbot) on Nov 12, 2014 at 08:36 UTC

    Please show the complete home.pl script, including the Form you are submitting. My guess is you should be creating the cookie in the wel.pl script using the parameter sent from the form in the home.pl script.

    poj