You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Presto, Patrick" <Pa...@qwest.com> on 2010/06/04 20:18:52 UTC

[users@httpd] Manipulate existing value of Response Header (Set-Cookie)

Hi Everyone,

I have been asked to rewrite a Set-Cookie header to resolve an application issue.  The tricky part is I need to obtain the current value in the header, then rewrite one little piece, and update the header with the new value so the end user will set their cookie correctly.

Using SetEnvIf I can do this for any header in the initial request, but not headers in the response (like the Set-Cookie header sent by the application to the user in the response).  Here is an example manipulating headers in the request.  This is exactly what I want to do but with the headers in the response.  I get the Host header value (append '.gotValue' to it), and update the Host header with that.

SetEnvIf Host (.*) newHostValue=$1.gotValue
Header set Host "%{newHostValue}e"


Does anyone know how I can grab the value of a response header, manipulate it, and update that header with the new value?   I have searched all over and I dont believe there is a simple solution.  Please prove me wrong!!!

Thank you,
Patrick

________________________________
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

RE: [users@httpd] Manipulate existing value of Response Header (Set-Cookie)

Posted by "Presto, Patrick" <Pa...@qwest.com>.
I did see this option and verified that it doesn't work with 2.0.52.  We have a couple apache web farms and this one is stuck on 2.0.52.  I should have provided that information initialy.  Any other ideas out there?

Thank you,

Patrick

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Friday, June 04, 2010 2:49 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Manipulate existing value of Response Header (Set-Cookie)

On Fri, Jun 4, 2010 at 2:18 PM, Presto, Patrick
<Pa...@qwest.com> wrote:
> Does anyone know how I can grab the value of a response header, manipulate
> it, and update that header with the new value?   I have searched all over
> and I dont believe there is a simple solution.  Please prove me wrong!!!

We have "Header edit ... "  in recent 2.2.4 and later:

http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header

--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Manipulate existing value of Response Header (Set-Cookie)

Posted by Eric Covener <co...@gmail.com>.
On Fri, Jun 4, 2010 at 2:18 PM, Presto, Patrick
<Pa...@qwest.com> wrote:
> Does anyone know how I can grab the value of a response header, manipulate
> it, and update that header with the new value?   I have searched all over
> and I dont believe there is a simple solution.  Please prove me wrong!!!

We have "Header edit ... "  in recent 2.2.4 and later:

http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org