Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: cookie problem

by fishmonger (Chaplain)
on Nov 11, 2014 at 21:33 UTC ( [id://1106891]=note: print w/replies, xml ) Need Help??


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

You should post short but complete scripts that demonstrate your issue.

Why do you have that continue statement? Using it as you have shown doesn't make any sense.

Replies are listed 'Best First'.
Re^4: cookie problem
by bigup401 (Pilgrim) on Nov 11, 2014 at 22:31 UTC
    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 }
Re^4: cookie problem
by bigup401 (Pilgrim) on Nov 11, 2014 at 22:29 UTC

    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 }

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106891]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found