On 16 May 2002, at 6:25, Gisle Aas wrote: > "Luuk de Boer" <[EMAIL PROTECTED]> writes: > > > On 15 May 2002, at 7:04, Gisle Aas wrote: > > > > > "Luuk de Boer" <[EMAIL PROTECTED]> writes: > > > > > > > I am busy making a program to get everything from a website > > > > which is using cookies. When I use $ua->cookie_jar($cookie_jar); > > > > he picks up the cookie I get (sessionid) places it in the next > > > > header. That's working fine but the syntax is completely > > > > different as normal browsers are doing. When do above the header > > > > I get is: Cookie: $Version=1; JSESSIONID="iibuorkp41.JS11"; > > > > $Path="/memberarea" > > > > > > > > and when I do the some stuff with mozilla or IE 6.0 or something > > > > else I get: Cookie: JSESSIONID=8szullke51.JS13 > > > > > > > > only the way the browser is using is working on that website. > > > > > > What are the Set-Cookie (and Set-Cookie2) headers that are sent > > > from the server in this case? What version of LWP are you using? > > > Also a dump of $ua->cookie_jar->as_string would be nice to see. > > > > > > The first format (with $Version=1 etc) is only supposed to be > > > returned if the server says it accept that kind of cookies, by > > > using the Set-Cookie2 header. > > > > > > > Here the set cookie headers: > > Set-Cookie: JSESSIONID=qqxmisgbf1.JS12;Path=/memberarea > > Set-Cookie2: > > JSESSIONID=qqxmisgbf1.JS12;Version=1;Discard;Path="/memberarea" > > > > version I am using is: LWP.pm = 5.53 > > > > and a dump of the cookie as_string : > > Set-Cookie3: JSESSIONID="0ga3rtgc91.JS12"; > > path="/memberarea"; domain="www.woonkrant.nl"; path_spec; > > discard; version=1 > > In which case it is totally correct to send back the Cookie in the RFC > 2965 format; Cookie: $Version=1; JSESSIONID="qqxmisgbf1.JS12"; ... > > Are you sure it is not some other cookies that are the problem? Since > your version of LWP there has been some updates to the HTTP::Cookie > module that might be relevant here. For instance this one: > > Fix HTTP::Cookies where there is a mix of Set-Cookie and > Set-Cookie2 headers. In that case we used to ignore all > Set-Cookie headers. Now we only ignore those Set-Cookie headers > that reference the same cookie as a Set-Cookie2 header. > > If you don't feel like upgrading the whole of LWP you might try to > just plug in http://www.linpro.no/lwp/libwww-perl/lib/HTTP/Cookies.pm > and see if that helps. > > I also wonder if it would make sense to add an option to HTTP::Cookies > to simply make it ignore any Set-Cookie2 headers found in requests. If > no real browser is ever going to implement RFC 2965 cookies, then > there is bound to be server apps out there that end up in some trouble > with them. >
I saw the new versions and will see if I can upgrade everything to the latest ... I watched the cookies by looking at ethereal (network capture program) so I think no other cookies were the problem. All browsers which I tested: IE6 / Mozilla (gecko engine) are giving the cookies the same way back. After I looked in the cookies.pm file I was thinking it was something with the rfc - implemented in libwww but not in any browser. I think a lot applications are made the way they see output of browsers not the output of the rfc so the best idea is to make an option in http::cookies to disable the official rfc and present the set-cookie as all browsers are doing. it's not nice but working ... grtz. Luuk
