Hello,

Some while ago I've posted a messages in which I enquired if there is
a module that copies a slightly modified output header to a response.

In particular, I wanted to set the same cookie on two domains in the
same request. The content generator sets the cookie on one domain and
I wanted to copy the Set-Cookie header and to modify its domain field.

For example:

The content generator sets:

Set-Cookie: name=value; domain=.sub.domain.net; expires=12000

and I want that the client gets:

Set-Cookie: name=value; domain=.sub.domain.net; expires=12000
Set-Cookie: name=value; domain=.domain.net; expires=12000

I've developed a module that is similar to mod_headers. I've added a
directive called HeaderExt that would be used as shown below in order
to obtain the functionality shown in the example above.

HeaderExt [always|onsuccess] copyedit Set-Cookie
^name=(.*)domain=[^;]+(.*) name=$1domain=.domain.net$2 [env=var]

The code is available here:
http://code.google.com/p/thought-tracker/source/browse/#hg%2Fcpp%2Fmod_headers2

Thank you for your feedback.

Sorin

Reply via email to