From 0ad13e061819e8fa9d1ea34dca4b66c08aa333f4 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Sun, 7 Jan 2024 00:25:13 -0500 Subject: [PATCH] cookie.d: Document use of empty string to enable cookie engine - Explain that --cookie "" can be used to enable the cookie engine without reading any initial cookies. As is documented in CURLOPT_COOKIEFILE. Ref: https://curl.se/libcurl/c/CURLOPT_COOKIEFILE.html Bug: https://github.com/curl/curl/issues/12643#issuecomment-1879844420 Reported-by: janko-js@users.noreply.github.com Closes https://github.com/curl/curl/pull/12646 --- docs/cmdline-opts/cookie.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/cmdline-opts/cookie.d b/docs/cmdline-opts/cookie.d index 0f858d6613..23f3f466a3 100644 --- a/docs/cmdline-opts/cookie.d +++ b/docs/cmdline-opts/cookie.d @@ -6,6 +6,7 @@ Arg: Protocols: HTTP Help: Send cookies from string/file Category: http +Example: -b "" $URL Example: -b cookiefile $URL Example: -b cookiefile -c cookiefile $URL See-also: cookie-jar junk-session-cookies @@ -23,8 +24,11 @@ If no '=' symbol is used in the argument, it is instead treated as a filename to read previously stored cookie from. This option also activates the cookie engine which makes curl record incoming cookies, which may be handy if you are using this in combination with the --location option or do multiple URL -transfers on the same invoke. If the file name is exactly a minus ("-"), curl -instead reads the contents from stdin. +transfers on the same invoke. + +If the file name is exactly a minus ("-"), curl instead reads the contents from +stdin. If the file name is an empty string ("") and is the only cookie input, +curl will activate the cookie engine without any cookies. The file format of the file to read cookies from should be plain HTTP headers (Set-Cookie style) or the Netscape/Mozilla cookie file format. -- 2.47.3