Skip to content

File argument to --cookie doesn't behave as expected #666

@baumanj

Description

@baumanj

According to the man page, the file format of the file to read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie file format.

I did this

Passed a file argument to --cookie of the form:

Cookie: foo=bar
Cookie: baz=qux

I expected the following

curl to send the cookie headers. I realized after reading the source that curl expects the file to contain:

Set-Cookie: foo=bar
Set-Cookie: baz=qux

It would be nice if the docs were clearer or if curl accepted either format.

curl/libcurl version

> curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.16.2.3 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz 

operating system

> uname -a
Linux 3.10.0-123.20.1.el7.x86_64 #1 SMP Thu Jan 29 18:05:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions