From Apache documentation: "Usage is basically similar to ProxyPassReverse, but instead of rewriting headers that are a URL, this rewrites the path string in Set-Cookie headers." It does not seem to be the case. Example: <Location /sss/> ProxyHTMLEnable On ProxyPass http://backend.server/ ProxyPassReverse / ProxyHTMLURLMap / /sss/ ProxyPassReverseCookiePath / /sss/ </Location> This will rewrite cookie path from backend server's /cgi-bin to /sss/ for the frontend server. Is this intended behaviour? Jie
Post verbatim headers of the bug you're describing.
Script setting the cookie: #!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; my $cookie_1 = $q->cookie(-name=>'jie_COOKIE_1', -value=>'BEST_COOKIE=chocolatechip', -domain=>'www-dev.xxxxxx.xxx.xx', -path=>'/cgi-bin'); print $q->header(-cookie=>$cookie_1); print $q->start_html('My cookie-set.cgi program'); print $q->h3('The cookie has been set'); print $q->end_html; ----------------------------------------------------- Running it directly to the backend server HTTP/1.0 200 OK Date: Sun, 29 Nov 2009 01:42:56 GMT Server: Apache/2.2.3 (Red Hat) Set-Cookie: jie_COOKIE_1=BEST_COOKIE%3Dchocolatechip; domain=xxx.xxx.xxx; path=/cgi-bin Content-Type: text/html; charset=ISO-8859-1 X-Cache: MISS from www-cacheE.xxx.xxx.xx X-Cache-Lookup: MISS from www-cacheE.xxx.xxx.xx:8080 Via: 1.0 www-cacheE.xxx.xxx.xx:8080 (squid/2.6.STABLE5) Proxy-Connection: close Running it on the rp server: HTTP/1.0 200 OK Date: Sun, 29 Nov 2009 01:46:24 GMT Server: Apache/2.2.3 (Red Hat) Content-Type: text/html; charset=utf-8 Set-Cookie: jie_COOKIE_1=BEST_COOKIE%3Dchocolatechip; domain=www-dev.xxx.xxx.xx; path=/sss/ X-Cache: MISS from www-cacheE.xxxx.xxx.xx X-Cache-Lookup: MISS from www-cacheE.xxx.xxx.xx:8080 Via: 1.0 www-cacheE.xxx.xx.xx:8080 (squid/2.6.STABLE5) Proxy-Connection: close
Path is defined as the component of the URL up to and including the rightmost slash. So the path of "/cgi-bin" is "/".
I changed the script to set the cookie path to "/cgi-bin/', but I got the same result from the RP as before.
From rfc 2965: Path Defaults to the path of the request URL that generated the Set-Cookie2 response, up to and including the right-most /.
*** Bug 48312 has been marked as a duplicate of this bug. ***
Note that due to a data loss on 26/27 Nov 2009 the issue that was originally created as bug 48295 was lost. It has been re-created as bug 48306.
*** Bug 51127 has been marked as a duplicate of this bug. ***
See also bug 54306 which could be a solution for such cases