On 2012-06-19 07:26, oh...@cox.net wrote:
Hi,

I spoke too soon :(....  The apr_table_mergen puts a comma (",") in between each cookie 
name/value pair, rather than a semicolon (";").

So, does anyone know how I can accomplish the merge of the cookie headers, but 
with semicolons in between the name/value pairs?

AFAIK there's no direct way to add a cookie to the Cookie request header. If you're sure that you already have a Cookie request header, you can use the "RequestHeader edit" directive (RequestHeader edit Cookie ".*" "$1; my_cookie"). However, afaik there's no directive implementing something like if_present_edit_else_set.

You'll have to do it manually:

const char *cookie = apr_table_get(r->headers_in, "Cookie");
if (cookie == NULL)
   apr_table_set(r->headers_in, "Cookie", my_cookie);
else
apr_table_setn(r->headers_in, "Cookie", apr_pstrcat(r->pool, cookie, "; ", my_cookie, NULL));

--
Sorin


Reply via email to