Re: Cannot have multiple Set-Cookie headers in response

Jacob Smullyan <[email protected]>
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
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/v2NluqamFyFXXLIRAqaZAJ0ec29QqVGbev/sQ5UTezURrirdaQCgiSVi
caFizCPx6/fy7wE2gABmV04=
=FdGr
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.