Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
curl doesn't send the last line cookie if there is no trailing newline #4946
I did this
The cookie is not sent according the verbose information (No HTTP cookie header is shown in request)
I expected the following
The cookie I saved should appear in request headers. The cookie should be sent.
Adding an extra blank line at the end of the cookie file then it works. The cookie will be sent.
I don't know if this can be counted as a bug. But it did cause me a few hours to find the problem and the documentation doesn't say anything about this requirement(an blank line at the end) for local cookie files, if I don't miss any details.
Do you actually mean an extra newline or do you mean a newline ? Because I can reproduce your problem if I make the cookie line in the file not have a newline at all, but I only need one newline at the end of that cookie line to make it work. (I tested on Linux though, and I won't be surprise if this is different on Windows).
I think I mean a newline.
As I posted in the question body
This doesn't work:
... so that we know we got the whole and not a partial line. Also, changed the formatting of the fields away from a table again since the table format requires a github-markdown tool version that we don't run on the web server atm. Reported-by: Sunny Bean Fixes #4946
See if this helps:
I'm convinced there never was one, we all just copied what they apparently used back in the day... And whatever we'll find today is just people who have tried to document what has been observed. Pretty much like we document how we use and create the file, as I expect that curl and wget are nowadays the two major consumers and producers of this style of cookie file.