Closed
Description
I did this
Command issued:
curl --cookie-jar cookies.txt -siX POST -H "Content-Type: application/json" -d '{"email": "email@dummy.com", "password": "password"}' http://localhost:8080/login
I expected the following
I got a Set-Cookie
header like this:
Set-Cookie: JSESSIONID=6EE0DE37D3A1C69A4FCFFA5931821B49; Path=/; SameSite=None; Secure
I hoped that the cookie will get written to the cookie jar, but it was not the case. There were no cookies in the file. The following was the contents of the cookie jar after execution:
# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
curl/libcurl version
curl 7.69.1 (x86_64-w64-mingw32) libcurl/7.69.1 OpenSSL/1.1.1e (Schannel) zlib/1.2.11 libidn2/2.3.0 libssh2/1.9.0 nghttp2/1.40.0
Release-Date: 2020-03-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP
operating system
Windows. I got curl packaged along with git bash (https://gitforwindows.org/).
comments
I tried it under Linux and it works perfectly. I couldn't get it to work with the curl
packaged along with my git bash.