Re: Cannot have multiple Set-Cookie headers in response
Jacob Smullyan <[email protected]>
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Message-ID | <[email protected]> |
I've verified that the problem is with httpd. Here is the same page (which puts two cookies in the response), first with mod_skunkweb, then with httpd: # wget -q -O- -s http://localhost/cookietest.html HTTP/1.1 200 OK Date: Sat, 22 Nov 2003 16:11:48 GMT Server: Apache/2.0.48 (Gentoo/Linux) mod_ssl/2.0.48 OpenSSL/0.9.6k DAV/2 SVN/0.31.0 SkunkWeb/3.4b5 Etag: mNmJNYtGMbTH2rUrZKTrWw== Set-Cookie: a=4; Set-Cookie: b=4; Content-Length: 13 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=ISO-8859-1 cookie set. # wget -q -O- -s http://localhost:8080/cookietest.html HTTP/1.0 200 OK Content-Length: 13 Etag: mNmJNYtGMbTH2rUrZKTrWw== Date: Sat, 22 Nov 2003 16:12:52 GMT Set-Cookie: b=4; Content-Type: text/html Server: SkunkWeb 3.4b5 cookie set. Fix will follow shortly. js On Sat, Nov 22, 2003 at 08:23:49AM -0500, Jacob Smullyan wrote: > On Fri, Nov 21, 2003 at 10:37:46PM -0800, Dan Chow wrote: > > I'm new to skunkweb and have been building my website with it. Skunkweb > > is pretty cool, but I ran into a problem that I saw that someone had > > posted and then said it might be resolved. But I still see that behavior. > > I'm using Skunkweb 3.4b5 with python 2.3.2 on a redhat 9.0 linux box. The > > problem I am seeing is that if I try to set multiple cookies in a single > > response, my browser (mozilla1.5) shows that only one is set. Also, > > when I use tcptrace, I only see the second cookie being sent over the > > wire. My test is the following: > > > > foo.html: > > ========= > > <:component /en/foo.pycomp connection=`CONNECTION`:> > > <html> > > Cookies sent > > </html> > > > > foo.pycomp: > > =========== > > # put in two cookies and see which is set > > connection.responseCookie["cookie1"] = "test1" > > connection.responseCookie["cookie2"] = "test2" > > > > foo.html calls foo.pycomp which sets two session cookies. And returns > > some html. I get back the page, but only one cookie is set. > > > > I've looked at Cookie.py and that doesn't seem to be the problem > > Also invoking skunkweb's > > HTTPConnection.response method in lib/Services/web/protocol.py returns > > both cookies in the response, so I am at a loss as to what is happening. > > Thanks for bringing this to my attention. If it has been brought up > before, it went by me completely, or I'd have fixed it. > > I believe you must be using the httpd service and that that is where > the bug lies. If you use apache/mod_skunkweb, I think you'll get both > Set-Cookie lines. > > The bug is that httpd currently takes the response headers and turns > them back into a dictionary, discarding duplicate keys (see > httpd.protocol._getHeaderDict). This is just plain wrong, obviously, > so I'll try to get a fix out later today. > > js
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/v4v2uqamFyFXXLIRAiR0AKCjeod8g31+12zoobiI2Omcg5NgBgCfSa5r K+vUgFOVt+5VseP0P9wW3f0= =P5XD -----END PGP SIGNATURE-----