Add warning.
[mkws-moved-to-github.git] / etc / mod_perl / MyApache2 / CopyCookie.pm
1 package MyApache2::CopyCookie;
2
3 use Apache2::Filter ();
4 use Apache2::RequestRec ();
5 use APR::Table ();
6
7 use Apache2::Const -compile => qw(OK);
8
9 sub handler {
10     my $f = shift;
11     warn "in MyApache2::CopyCookie (f=$f)";
12
13     my $ho = $f->r->headers_out;
14     my $cookie = $ho->get('Set-Cookie');
15     open F, ">/tmp/mike";
16     print F "MyApache2::CopyCookie headers_out='$ho', cookie='$cookie'";
17     $ho->set('X-Set-Cookie', $cookie);
18     my $extra = $ho->get('X-Set-Cookie');
19     print F "MyApache2::CopyCookie extra cookie='$extra'";
20     close F;
21     return Apache2::Const::OK;
22 }
23
24 1;