http://www.perlmonks.org?node_id=465591


in reply to Cookie Problem

You are trying to get cookie after send it to browser. It's only available at next request, it accepted!

Define your value with same of cookie set, or try to redirect, and check cookie avaliable.

$exit_link = "$ENV{'QUERY_STRING'}"; $cookie = $query->cookie(-name=>'aa_exit', -value=>$exit_link, -expires=>'+4h', -path=>'/'); ... $theCookie = $query->cookie('aa_exit'); if(!$theCookie){ $exit_link = "$ENV{'QUERY_STRING'}"; # $theCookie = $query->cookie('aa_exit'); WRONG $theCookie = $ENV{'QUERY_STRING'}; ... }

--
Marco Antonio
Rio-PM