Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: cookie problem

by GotToBTru (Prior)
on Nov 11, 2014 at 20:26 UTC ( [id://1106877]=note: print w/replies, xml ) Need Help??


in reply to cookie problem

What is $cg? I don't see it defined anywhere, nor do you have any module names that might provide a clue.

1 Peter 4:10

Replies are listed 'Best First'.
Re^2: cookie problem
by bigup401 (Pilgrim) on Nov 11, 2014 at 21:28 UTC

    cg is defined

    my $cg = new CGI;

      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.

        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 }

        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 }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found