Bug 7195 - mod_proxy removes Set-cookie headers
Summary: mod_proxy removes Set-cookie headers
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 1.3.24
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
: 7362 7748 7874 8382 9212 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-03-18 08:35 UTC by Siegfried Delwiche
Modified: 2004-11-16 19:05 UTC (History)
6 users (show)



Attachments
proposal of correction for proxy_http.c (22.31 KB, text/plain)
2002-03-18 11:08 UTC, Siegfried Delwiche
Details
proposal of correction for proxy_util.c (48.21 KB, text/plain)
2002-03-18 11:09 UTC, Siegfried Delwiche
Details
proposal of correction for mod_proxy.h (13.50 KB, text/plain)
2002-03-18 11:09 UTC, Siegfried Delwiche
Details
Successful fix on 2.24 with this series of changes (13.32 KB, text/plain)
2002-08-01 18:23 UTC, Jacques Amar
Details
Successful fix on 2.24 with this series of changes (34.06 KB, text/html)
2002-08-01 18:24 UTC, Jacques Amar
Details
Successful fix on 2.24 with this series of changes (60.47 KB, text/plain)
2002-08-01 18:25 UTC, Jacques Amar
Details
Successful fix on 2.24 with this series of changes (11.15 KB, text/plain)
2002-08-01 18:25 UTC, Jacques Amar
Details
Successful fix on 2.24 with this series of changes (53.98 KB, text/plain)
2002-08-01 18:25 UTC, Jacques Amar
Details
Successful fix on 2.24 with this series of changes (21.75 KB, text/plain)
2002-08-01 18:26 UTC, Jacques Amar
Details
Successful fix on 2.24 with this series of changes (47.37 KB, text/plain)
2002-08-01 18:26 UTC, Jacques Amar
Details
mod_proxy_cookie_fix.tgz - Tar/zipped file of successful fix on 2.24 (Sorry for previous posts) (58.78 KB, tar/zip)
2002-08-01 18:32 UTC, Jacques Amar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Siegfried Delwiche 2002-03-18 08:35:03 UTC
In apache 1.3.23, the new mod_proxy removes cookies headers: some sites, as 
hotmail, return more than one Set-cookie headers. After ap_overlap_tables in 
proxy_http.c # 530, there is only one remaining!
This is blocking since access to hotmail, yahoo ... is no longer possible.
Comment 1 Siegfried Delwiche 2002-03-18 11:08:23 UTC
Created attachment 1364 [details]
proposal of correction for proxy_http.c
Comment 2 Siegfried Delwiche 2002-03-18 11:09:05 UTC
Created attachment 1365 [details]
proposal of correction for proxy_util.c
Comment 3 Siegfried Delwiche 2002-03-18 11:09:57 UTC
Created attachment 1366 [details]
proposal of correction for mod_proxy.h
Comment 4 Justin Erenkrantz 2002-03-18 15:33:42 UTC
I believe this has been fixed in HEAD of Apache 1.3.  Please try the
latest CVS version.

This should be included in the forthcoming 1.3.24 release (possibly
this week).
Comment 5 Joshua Slive 2002-03-22 15:22:02 UTC
*** Bug 7362 has been marked as a duplicate of this bug. ***
Comment 6 Brian Bothwell 2002-03-28 13:40:55 UTC
This bug still seems to exist in 1.3.24.

I upgraded our 1.3.20 to 1.3.24 and pages using mulitple cookies were broken, due to only the LAST "Set-Cookie:" being passed thru the mod_proxy server.
Comment 7 Joshua Slive 2002-03-28 19:14:57 UTC
There was another fix for this issue committed just after 1.3.24 was released.
You can grab a snapshot of the current code at:
http://cvs.apache.org/snapshots/apache-1.3/
or you can find a patch at
http://cvs.apache.org/viewcvs.cgi/apache-1.3/src/modules/proxy/proxy_http.c.diff?r1=1.89&r2=1.90

Please reopen this report again if the problem is not fixed.
Comment 8 Siegfried Delwiche 2002-04-02 08:05:55 UTC
The current snaphsot and the version 1.3.24 do not contain the fixes made in 
the snapshot /proxy_http.c/1.87/Wed Mar 13 23:12:04 2002//
The problem is not fixed currently!
Comment 9 Joshua Slive 2002-04-02 15:32:41 UTC
Your message is unclear.  As I said, the additional fix was committed after 1.3.24
was released:
http://cvs.apache.org/viewcvs.cgi/apache-1.3/src/modules/proxy/proxy_http.c.diff?r1=1.89&r2=1.90
Are you saying that this additional fix does not fix the problem?
Comment 10 Joshua Slive 2002-04-05 21:59:46 UTC
*** Bug 7748 has been marked as a duplicate of this bug. ***
Comment 11 Graham Leggett 2002-04-07 18:46:16 UTC
A fix for this bug was committed to 1.3.24-dev, but this fix didn't work
properly due to the existence of commas in cookies. A new fix was committed
and released in v1.3.24, but this fix was broken. The fix to the fix to the
fix was committed to v1.3.25-dev, and with some luck the bug is at last,
dead.
Comment 12 Joshua Slive 2002-04-09 19:13:24 UTC
*** Bug 7874 has been marked as a duplicate of this bug. ***
Comment 13 Joshua Slive 2002-04-23 13:29:23 UTC
*** Bug 8382 has been marked as a duplicate of this bug. ***
Comment 14 dauhee 2002-04-27 02:54:34 UTC
I patched 1.3.24 with 
http://cvs.apache.org/viewcvs.cgi/apache-
1.3/src/modules/proxy/proxy_http.c.diff?r1=1.89&r2=1.90
and installed it.

The Set-cookie bug is fixed. However I am seeing weird characters added to 
html pages that are proxied by mod_proxy. After viewing the source, this is 
what I see.

"
4d
<BODY>
normal html
</BODY>
0
"

The additional characters are '4d'(before the <BODY>) and '0'(after </BODY>).

I have captured an image of another page and you can see it here.
http://www.singaporeinvestor.com/sembcorp.jpg
The additional characters are "8c8" and "0"

I have reverted back to 1.3.22 and the problem is gone.





Comment 15 Cliff Woolley 2002-04-27 03:02:20 UTC
What you're seeing is the proxy dechunk bug, which is different than the issue 
in this PR.  It is also fixed in CVS.
Comment 16 Cliff Woolley 2002-05-17 21:00:00 UTC
*** Bug 9212 has been marked as a duplicate of this bug. ***
Comment 17 Xavier Antoviaque 2002-06-23 21:10:41 UTC
The bug does not seem do be fixed for me. I work with the 1.3.26 version of
apache, I also tried to download the current version of proxy_http.c from the
CVS, and both give the same result :

The result of a query, by direct access :

HTTP/1.1 200 OK
Server: Zope/(Zope 2.5.1 (source release, python 2.1, linux2), python 2.1.3,
linux2) ZServer/1.1b1
Date: Sun, 23 Jun 2002 20:56:39 GMT
Content-Type: text/html
Etag:
Content-Length: 3897
Set-Cookie: __ac_plebia="FLP2aWVyOmRk%0A"; Expires=31 Dec 2020 00:00:00 GMT; Path=/
Set-Cookie: __ac_name="Xavier"; Expires=Mon, 23 Jun 2003 20:56:39 GMT; Path=/

The result of the same query, through apache and mod_proxy :

HTTP/1.1 200 OK
Date: Sun, 23 Jun 2002 20:51:38 GMT
Server: Zope/(Zope 2.5.1 (source release, python 2.1, linux2), python 2.1.3,
linux2) ZServer/1.1b1
Content-Length: 3882
Content-Type: text/html
Etag:
Set-Cookie: __ac_name="Xavier"; Expires=Mon, 23 Jun 2003 20:51:39 GMT; Path=/
X-Cache: MISS from www.plebia.org
Keep-Alive: timeout=15, max=95
Connection: Keep-Alive

As you can see, the __ac_plebia cookie seems to be dropped.
Comment 18 bigmouth 2002-07-05 09:19:52 UTC
Just to confirm, this bug is still present.  With the advent of the
chunked-encoding issue, users experiencing this bug can't afford *not* to
upgrade.  Sorry, I'm not a C hacker so I can't help fix it...
Comment 19 Huw Jones 2002-08-01 16:52:02 UTC
I too see this problem using 1.3.26 proxying for an application server. An 
older proxy (1.3.14) handles the multiple cookies OK. I hope this helps.
Comment 20 Jacques Amar 2002-08-01 18:23:03 UTC
Created attachment 2562 [details]
Successful fix on 2.24 with this series of changes
Comment 21 Jacques Amar 2002-08-01 18:24:35 UTC
Created attachment 2563 [details]
Successful fix on 2.24 with this series of changes
Comment 22 Jacques Amar 2002-08-01 18:25:05 UTC
Created attachment 2564 [details]
Successful fix on 2.24 with this series of changes
Comment 23 Jacques Amar 2002-08-01 18:25:28 UTC
Created attachment 2565 [details]
Successful fix on 2.24 with this series of changes
Comment 24 Jacques Amar 2002-08-01 18:25:47 UTC
Created attachment 2566 [details]
Successful fix on 2.24 with this series of changes
Comment 25 Jacques Amar 2002-08-01 18:26:17 UTC
Created attachment 2567 [details]
Successful fix on 2.24 with this series of changes
Comment 26 Jacques Amar 2002-08-01 18:26:40 UTC
Created attachment 2568 [details]
Successful fix on 2.24 with this series of changes
Comment 27 Jacques Amar 2002-08-01 18:32:22 UTC
Created attachment 2569 [details]
mod_proxy_cookie_fix.tgz - Tar/zipped file of successful fix on 2.24 (Sorry for previous posts)
Comment 28 Jacques Amar 2002-08-01 18:34:35 UTC
 I was successful in modifying/compiling mod_proxy and have had no multiple 
cookie errors since. I'm not sure if I modified any other files, please tell me 
if you get a compile error and I'll look up any other file. 
 
 
Comment 29 Huw Jones 2002-08-02 15:27:46 UTC
Unresolved for 1.3.x - still requires a fix
Comment 30 Graham Leggett 2002-09-02 15:07:39 UTC
Is it possible for you to use the diff tool to create a patch for us? In the
files you uploaded, it is difficult to figure out what you changed.
Comment 31 Graham Leggett 2002-09-02 20:44:34 UTC
Looking at this patch further, it seems to try and fix this bug in v1.3.24. This
bug has already been fixed in v1.3.26 - please confirm that the problem is fixed
there.

(Please don't confuse this bug with a separate problem where cookies set within
the proxy itself, ie cookies that do not originate from the backend server, are
added to the response twice, this causing cookie duplication).
Comment 32 patrick thun 2002-10-26 03:46:42 UTC
Same problem exist in Apache 2.0 for windows. Anyone has a solution?
Comment 33 William A. Rowe Jr. 2002-10-26 05:36:02 UTC
  Then why did you reopen an apache 1.3 bug?

  Please submit a new bug AFTER you search for a corresponding 2.0 bug,
  and make sure to note this original 1.3 bug.

  And be sure you FIRST confirm it still exists in the 2.0.43 release.
Comment 34 patrick thun 2002-10-28 09:46:30 UTC
Please disregard my previous comment about the bug in Apache 2.0 for windows.

The cause of the Set-cookie bug was due to my particular implementation to 
translate the domain value in the Set-cookie field.

I have corrected this problem. Sorry for any trouble caused.