in reply to Re^2: cookie problem
in thread cookie problem
poj#!perl # home.pl use strict; use CGI; my $q = new CGI; print $q->header(),$q->start_html, $q->start_form(-method=>"post",-action=>"wel.pl"), $q->b("ID : "), $q->textfield(-name=>"id", -value=>$q->cookie('id')), $q->submit(),$q->end_form,$q->end_html; #!perl # wel.pl use strict; use CGI; my $q = new CGI; my $id = $q->param('id'); my $cookie = $q->cookie( -name => 'id', -value => $id, -expires => '+2m', -path => '/'); if ( ! $id ){ print $q->redirect(-uri=>"home.pl", -cookie=>$cookie); } else { print $q->header(-cookie=>$cookie); print $q->start_html, $q->a({-href=>'home.pl'},'home'), $q->p("Hello $id"),$q->end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: cookie problem
by fishmonger (Chaplain) on Nov 12, 2014 at 17:00 UTC | |
by bigup401 (Pilgrim) on Nov 12, 2014 at 18:51 UTC | |
by fishmonger (Chaplain) on Nov 12, 2014 at 22:56 UTC | |
by bigup401 (Pilgrim) on Nov 13, 2014 at 09:37 UTC | |
by poj (Abbot) on Nov 13, 2014 at 09:41 UTC | |
| |
by poj (Abbot) on Nov 12, 2014 at 19:16 UTC |