Miles Crawford wrote: > > On: > http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_out_ > and > http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_err_headers_out_ > > > it is suggested that the proper syntax for adding a header is: > > $r->headers_out->add('Set-Cookie' => $cookie); > > This howerver does not work.
of course it does. you can see from yourself in the mod_perl test suite: t/response/TestAPI/err_headers_out.pm [21]: $r->err_headers_out->add('X-err_headers_out' => "err_headers_out"); using the set() or add() interface is the preferred method, over the tied interface shown below. > The example at: > http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_err_header_out_ > > > has it right, with: > > $r->headers_out->{'Pragma'} = "no-cache"; this documentation is for the compat layer. I can't recall offhand whether this syntax works without Apache2::compat or not. but regardless, so you know, the first example adds to any existing Set-Cookie outgoing headers, and only in the headers_out table, which will not persist across REDIRECT responses (use err_headers_out for that). the second example overwrites any existing Pragma headers in headers_out table. --Geoff --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]