On Fri, Jul 27, 2012 at 7:13 AM, <kharp...@oreillyauto.com> wrote:

>
> Hello all,
>
> I've been researching mod_headers all day trying to figure out how to do
> this... time to ask the group.
>
> I would like to be able to use the information in a Set-Cookie header to
> determine if I should set an additional cookie.  For example, if Set-Cookie
> "mycookie=abc123-happy" comes through as a response header, I want to
> create another Set-Cookie header with just the "happy" portion of the
> original Set-Cookie header.
>
> I know mod_headers can edit an existing header, but I need the original
> header (Set-Cookie "mycookie") to stay in tact, while I create another
> Set-Cookie header before sending it down the wire.
>
> Thanks for any input or ideas.
>
>
> Kyle Harper
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS ยง 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>

Try this untested:

SetEnvIf Set-Cookie mycookie=abc123-happy HAVE_happy
Header add Set-Cookie "mycookie2=happy" env=HAVE_happy

This is if the value of the cookie is static (always the same). I'm not
sure how is this going to work in case you need dynamic one which will need
use of regular expression. Then you can't set the variable to a value of
the regular expression which means you will need to use CGI approach.

Reply via email to