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


in reply to Re^2: CGI Cookie creation problem
in thread CGI Cookie creation problem

Are you sure? When I run this script from the command line it gives me pretty much what you'd expect:

G:\>type x.pl use CGI (); #Create Cookie $mc_cookie_domain_name = ".sample.com"; $mc_path_script = "/"; $mc_cookie_expiration_time = "+2h"; $mc_cookie_name = "Sample_Cookie"; #$mc_cookie_value = $mc_form_member_name; $mc_cookie_value = "Logged In"; my $cgi = CGI->new(); my $cookie = $cgi->cookie(-name => $mc_cookie_name, -value => $mc_cook +ie_value, -expires => $mc_cookie_expiration_time, -domain => $mc_cookie_domain_n +ame); print $cgi->redirect(-url => 'https://www.sample.com/cgi-bin/confirm_a +ccount_2.p l', -cookie => $cookie); #End of Create Cookie G:\>perl x.pl Status: 302 Found Set-Cookie: Sample_Cookie=Logged%20In; domain=.sample.com; path=/; exp +ires=Tue, 19-Jun-2012 16:45:45 GMT Date: Tue, 19 Jun 2012 14:45:45 GMT Location: https://www.sample.com/cgi-bin/confirm_account_2.pl G:\>