I hope you mean $r->headers_out, if yes then i do have
that line too, although it fails miserably. This is
what i've got so far:

 my $req = $r->pool();
my $cookie = APR::Request::Cookie->new($req, name => "foo", value => "bar");
 $cookie->path('/');
 $cookie->domain('192.168.1.155');
 $cookie->expires('+1d');
 $r->headers_out->add('Set-Cookie'=>$cookie);

This does not set the cookie whatsoever, i tried
$r->err_headers_out... still no luck.
Here is a fully working exapmle:

http://p6m7g8.net/cookie


PerlModule TEST::Cookie
<Location /cookie>
 SetHandler perl-script
 PerlResponseHandler TEST::Cookie
 PerlOptions +ParseHeaders
 Options +ExecCGI
</Location>


package TEST::Cookie;

use strict;
use warnings FATAL => 'all';
use Carp;

use Apache2::Request ();
use Apache2::RequestRec ();
use Apache2::Const -compile => qw(OK);

use APR::Table ();
use APR::Request::Cookie ();

sub handler () {

       my $r = shift;
       my $req = $r->pool();

       my $cookie = APR::Request::Cookie->new(
$req, name => "foo", value => time()
        );

       $r->err_headers_out->add('Set-Cookie' => $cookie);

       $r->print("Content-Type: text/plain\n\n");
       $r->print("Testing....");

       return Apache2::Const::OK;
}


END ---------------------------------------------------------
   What doesn't kill us can only make us stronger.
              Nothing is impossible.
                                
Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
    http://www.liquidityservicesinc.com
       http://www.liquidation.com
       http://www.uksurplus.com
       http://www.govliquidation.com
       http://www.gowholesale.com


Reply via email to