------=_Part_8836_3293175.1209375233106
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Wed, Apr 23, 2008 at 5:28 PM, Perrin Harkins wrote:

> On Mon, Apr 21, 2008 at 4:30 PM, J Amuse wrote:
> >
> >
> > http://perl.apache.org/docs/2.0/user...sponse_Headers
> >
> >

>
> Thanks Perrin.
> This link references the set method, which will overwrite the header
> value. I want to append text (i.e. append a secure and httponly flag if
> there is a Set-Cookie header in the HTTP response). Is this possible with
> the overlay method? How can I extract the contents of the Set-Cookie header
> to modify it?
>
>

For future reference, I was able to manipulate the HTTP headers via the
following code snippet:

sub handler
{
my $f = shift;

unless ($f->ctx)
{
my $SecureFlags = "\; secure\; HttpOnly\;";
my $Cookie = $f->r->headers_out->get("Set-Cookie");

if ($Cookie)
{
$Cookie .= $SecureFlags;
$f->r->headers_out->set("Set-Cookie" => "$Cookie");
}
$f->ctx(1);
}
}

Thanks again to Perrin for all his help.

------=_Part_8836_3293175.1209375233106
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Wed, Apr 23, 2008 at 5:28 PM, Perrin Harkins <errin@elem.com" target="_blank">perrin@elem.com> wrote:


On Mon, Apr 21, 2008 at 4:30 PM, J Amuse <jamuse@gmail.com> wrote:



Thanks Perrin.
This link references the set method, which will overwrite the header value. I want to append text (i.e. append a secure and httponly flag if there is a Set-Cookie header in the HTTP response). Is this possible with the overlay method? How can I extract the contents of the Set-Cookie header to modify it?

 

For future reference, I was able to manipulate the HTTP headers via the following code snippet:

sub handler
{
    my $f = shift;

    unless ($f->ctx)
    {

        my $SecureFlags = "\; secure\; HttpOnly\;";
        my $Cookie = $f->r->headers_out->get("Set-Cookie");
       
        if ($Cookie)
        {
            $Cookie .= $SecureFlags;

            $f->r->headers_out->set("Set-Cookie" => "$Cookie");
        }
        $f->ctx(1);
    }
}

Thanks again to Perrin for all his help.



------=_Part_8836_3293175.1209375233106--