Hi again, yes - the solution works. Now tntnet sends one set-cookie header per cookie and both konqueror and firefox accept 2 cookies.
The rfc 2109 is broken. The code is checked in trunk and will be in the next release. By the way - I plan to release it soon. Tommi On Donnerstag, 29. Oktober 2009 23:58:46 Tommi Mäkitalo wrote: > Hi, > > thank you for your help (also ButtaKnife). I also saw, that apache2 with a > little php5 does it that way. > > The problem is, that tntnet uses a std::map for http headers and a std::map > has unique keys, so I can't just put two Set-Cookie headers into the > std::map. > > But I have maybe a solution for this. I just changed the way tntnet sends > the reply. Missing headers are not put into the std::map prior sending any > more but written directly to the socket. So I can maybe send multiple > Set-Cookie headers without putting them into the map. Tntnet just needs to > iterate through the cookies. > > I have to add a way to iterate through cookies first. > > Tommi > > On Donnerstag, 29. Oktober 2009 19:03:39 you wrote: > > I just did a preliminary search, and what I'm reading says "Multiple > > Set-Cookie headers can be issued in a single server response." Have you > > tried issuing it as: > > > > Set-Cookie: AnotherCookie=AnotherValue; Path=/; Version=1 > > Set-Cookie: SomeCookie=SomeValue; Path=/; Version=1 > > > > ? > > > > It may or may not be required to be issued in that way, I don't know, > > but according to what I read with that quick search, it *can* be issued > > that way. Maybe you should try it out, and if that works, then I see no > > reason not to just go ahead and use that method, and forget about trying > > to make the comma-separated list work. > > > > (For reference, I found my information here: > > http://www.htaccesselite.com/set-cookie-with-http-vt186.html) > > > > Kitty > > > > Tommi Mäkitalo wrote: > > > Hi, > > > > > > looks like there is at least one bug. It should work like you expect > > > but it doesn't. > > > > > > The reason is, that the set-cookie header is wrong in tntnet. The spec > > > (http://www.ietf.org/rfc/rfc2109.txt) is somewhat unclear to me. It > > > says: set-cookie = "Set-Cookie:" cookies > > > cookies = 1#cookie > > > cookie = NAME "=" VALUE *(";" cookie-av) > > > NAME = attr > > > VALUE = value > > > cookie-av = "Comment" "=" value > > > > > > | "Domain" "=" value > > > | "Max-Age" "=" value > > > | "Path" "=" value > > > | "Secure" > > > | "Version" "=" 1*DIGIT > > > > > > When I understand it correctly, "Set-Cookie:" is followed by one or > > > more cookies. Until now tntnet separates the cookies by space. The spec > > > tells, that the list is a comma-separated list. I put the comma here as > > > a separator, but it does not work neither with firefox nor konqueror. > > > > > > The set-cookie header looks like this (after my fix): > > > > > > Set-Cookie: AnotherCookie=AnotherValue; Path=/; Version=1, > > > SomeCookie=SomeValue; Path=/; Version=1 > > > > > > But it does not work :-(. It looks ok for me. > > > > > > Any ideas? > > > > > > > > > Tommi > > > > > > On Mittwoch, 28. Oktober 2009 18:18:19 Shadowcat wrote: > > >> Hi, > > >> > > >> I'm having a bit of an issue. Any time I try to set two cookies in > > >> one function, only the one that's lowest in alphabetical order gets > > >> set. It doesn't matter what order I put them in in the code, only the > > >> one gets set. For example: > > >> > > >> reply.setCookie( "SomeCookie", "SomeValue" ); > > >> reply.setCookie( "AnotherCookie", "AnotherValue" ); > > >> > > >> Only "AnotherCookie" will be set. If I switch the order, it's still > > >> "AnotherCookie" that gets set. But if I were to change its name to > > >> "ZomgACookie!", then "SomeCookie" would be the one that gets set. > > >> > > >> How can I get both of them set? > > >> > > >> ---------------------------------------------------------------------- > > >>-- --- --- Come build with us! The BlackBerry(R) Developer Conference > > >> in SF, CA is the only developer event you need to attend this year. > > >> Jumpstart your developing skills, take BlackBerry mobile applications > > >> to market and stay ahead of the curve. Join us from November 9 - 12, > > >> 2009. Register now! http://p.sf.net/sfu/devconference > > >> _______________________________________________ > > >> Tntnet-general mailing list > > >> [email protected] > > >> https://lists.sourceforge.net/lists/listinfo/tntnet-general > > > > > > ----------------------------------------------------------------------- > > >-- ----- Come build with us! The BlackBerry(R) Developer Conference in > > > SF, CA is the only developer event you need to attend this year. > > > Jumpstart your developing skills, take BlackBerry mobile applications > > > to market and stay ahead of the curve. Join us from November 9 - 12, > > > 2009. Register now! http://p.sf.net/sfu/devconference > > > _______________________________________________ > > > Tntnet-general mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/tntnet-general > > --------------------------------------------------------------------------- >--- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is > the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Tntnet-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/tntnet-general ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
