my $cookie_out = CGI::Cookie->new( -name => $hitid, -value => $cell, -domain => 'www.bbb.com', -path => '/', -secure => $ENV{HTTPS}, -expires => '+1d', ); $r->err_headers_out->add('Set-Cookie' => $cookie_out); $r->headers_out->set(Location => $url); return &Apache::REDIRECT;