Skip to content

-c or --cookie-jar doesn't accept some cookie names #2564

@anshnd

Description

@anshnd

I did this

curl -v --cookie-jar cookies.txt https://httpbin.org/cookies/set?domain=value

I expected the following

cookies.txt to be created and contain
httpbin.org FALSE / TRUE 0 domain value

Instead I got

* skipped cookie with bad tailmatch domain: value
and no cookies.txt file. It seems curl is wrongly applying attribute semantics to the cookie's name. Note that https://tools.ietf.org/html/rfc6265#section-4.2.1 sets no restrictions on cookie-name

curl/libcurl version

libcurl/7.53.1

[curl -V output]
curl 7.53.1 (x86_64-redhat-linux-gnu) libcurl/7.53.1 NSS/3.35 zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.3) libssh2/1.8.0 nghttp2/1.21.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy Metalink PSL

operating system

tested on Mac and Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions