Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 19621 invoked from network); 29 Apr 2009 10:32:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Apr 2009 10:32:33 -0000 Received: (qmail 15926 invoked by uid 500); 29 Apr 2009 10:32:28 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 15882 invoked by uid 500); 29 Apr 2009 10:32:28 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 15873 invoked by uid 99); 29 Apr 2009 10:32:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 10:32:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [79.148.234.206] (HELO correo.xeridia.com) (79.148.234.206) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 10:32:20 +0000 Received: from localhost (localhost [127.0.0.1]) by correo.xeridia.com (Postfix) with ESMTP id B9BC03781E7 for ; Wed, 29 Apr 2009 12:31:59 +0200 (CEST) Received: from correo.xeridia.com ([127.0.0.1]) by localhost (correo.xeridia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08750-09 for ; Wed, 29 Apr 2009 12:31:59 +0200 (CEST) Received: from [192.168.1.24] (unknown [192.168.1.24]) by correo.xeridia.com (Postfix) with ESMTP id 85ADB3781E3 for ; Wed, 29 Apr 2009 12:31:59 +0200 (CEST) Message-ID: <49F82C9F.5000203@xeridia.com> Date: Wed, 29 Apr 2009 12:31:59 +0200 From: =?ISO-8859-1?Q?Diego_Manilla_Su=E1rez?= User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Modify response header Hi. I have a problem with a JEE app deployed on Tomcat: it needs to share the same session across different subdomains, but Tomcat (according to the specs, I think) doesn't explicitly set a multi-subdomain cookie to track the session. I've found some people with the same problem that uses a Tomcat valve to overcome this problem, yet it doesn't seem to work in 100% of cases. The code that controls the cookie data doesn't seem to be extensible, so I'm trying to use Apache (linked to Tomcat with mod_proxy) to add the correct domain to the cookie sent by Tomcat. The cookie originally sent by Tomcat looks like this: Set-Cookie: JSESSIONID=A2642645DC66D29552C87886DBA3CFE4; Path=/contextpath And I need it to look like this: Set-Cookie: JSESSIONID=A2642645DC66D29552C87886DBA3CFE4; Path=/contextpath; Domain=.my.domain At first, I thought that with a combination of mod_headers and mod_setenvif this could be done, with something like this: SetEnvIf Set-Cookie ^(JSESSIONID=.*)$ jsessionid_value=$1 Header set Set-Cookie "%{jsessionid_value}e; Domain=.my.domain" env=jsessionid_value But SetEnvIf doesn't seem to support conditionally setting environment variables depending on response headers, just the request ones. And I don't know if it allows the use of capturing groups and backreferences, since the documentation doesn't mention it. Any other alternative before giving up and modifying some of Tomcat classes? thanks in advance ** * *** **** --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See 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