curl-users
Re: -L works with cookies iff -b <filename>
Date: Mon, 27 Nov 2000 09:01:21 +0100 (MET)
On Wed, 22 Nov 2000, Venkataramana Mokkapati wrote:
> % curl http://www.xyz/com/a.htm -L
> Let us say the URL redirects to R1 after setting cookie:
> Location: R1
> Set-Cookie: a=1
> Now, sending request for R1, curl does NOT send cookie!
Correct. As the cookie parser has not been "switched on".
> It is becasue data->cookie is NULL in the code.
> Instead, if I use
> % curl http://www.xyz.com/a.htm -L -b dummyfilename
> then, data->cookie is set and redirection to R1 is
> accompanied by correct cookies
Correct. As the -b options "switches on" the cookie awareness.
> Basically, an initialization done when cookie file is present is
> essential for the -L to work with cookies
You could say that -b is essential to work with cookies. The -L doesn't
really change that fact.
> if I use
> % curl http://www.xyz.com/a.htm -L -b /dev/null
> it works!!
Yes.
> Workaround is to use -b <filename> with -L always...but
> it is a bug neverthless
Is it really? I've documented this behaviour, as good as I've could. Feel
free to submit better descriptions of this behaviour.
Like many things in curl, they don't "turn on" automatically. You have to
decide what you want curl to do and how you want it to behave. I keep the
defaults to a minimum.
-- Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/Received on 2000-11-27