[EMAIL PROTECTED] writes:

>> Is there a publically accessible site that exhibits this problem?
>
> I've set up a small example which illustrates the problem. Files can
> be found at http://dev.mesca.net/wget/ (using demo:test as login).

Thanks for setting up this test case.  It has uncovered at least two
bug in the cookie code.

> $ wget --http-user=demo --http-passwd=test --cookies=on
> --save-cookies=cookie.txt http://dev.mesca.net/wget/setcookie.php

The obvious problem is that this command lacks --keep-session-cookies,
and the cookie it gets is session-based.  But there are other problems
as well: if you examine the cookie.txt produced by (the amended
version of) the first command, you'll notice that the cookie's path is
"wget/setcookie.php".  For one, the "setcookie.php" part should have
been stripped (Mozilla does this, I've just checked).  Second, the
path should always begin with a slash.  Either of these problems would
guarantee that no other URL would ever match this cookie.

I've now fixed both bugs in the CVS, along with a third, unrelated
bug.  Please let me know if the latest CVS works for you.  (It works
for me on the example you set up.)

Several notes on usage: --cookies is the default, so you don't need
--cookies=on to send and receive them.  Second, it's somewhat shorter
to specify the user name and password in the URL.  Finally, don't
forget --keep-session-cookies when saving the cookies.

Reply via email to