package My::Filter; use strict; use warnings; use CGI::Cookie (); use Apache2::RequestRec (); use APR::Table (); use Apache2::Const -compile => qw(REDIRECT); my $location = "http://www.test.com"; sub handler { my $r = shift; my $cookie = CGI::Cookie->new(-name=> 'mod_perl', -value => 'awesome'); $r->err_headers_out->add('Set-Cookie' => $cookie); $r->headers_out->set(Location => $location); return Apache2::Const::REDIRECT; } 1; #### PerlOutputFilterHandler My::Filter