my $val = "xttsyyd6774"; my $link = "http://localhost/test.pl?val=$val"; # main link if ($val) { my $cookie = $cgi->cookie(-name => 'demo', -value => $val, -expires => '+20m'); print $cgi->redirect(-location =>$link, -cookie =>$cookie); next; # after creating our cookie with one time redirect then continue do other staffs on page }
so after creating cookie and page comes back from redirect then i continue doing other things on page. but am getting this error
This page isn’t working localhost.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS