cookie.d 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Short: b
  2. Long: cookie
  3. Arg: <data|filename>
  4. Protocols: HTTP
  5. Help: Send cookies from string/file
  6. Category: http
  7. Example: -b cookiefile $URL
  8. Example: -b cookiefile -c cookiefile $URL
  9. Added: 4.9
  10. ---
  11. Pass the data to the HTTP server in the Cookie header. It is supposedly
  12. the data previously received from the server in a "Set-Cookie:" line. The
  13. data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
  14. If no '=' symbol is used in the argument, it is instead treated as a filename
  15. to read previously stored cookie from. This option also activates the cookie
  16. engine which will make curl record incoming cookies, which may be handy if
  17. you are using this in combination with the --location option or do multiple URL
  18. transfers on the same invoke. If the file name is exactly a minus ("-"), curl
  19. will instead read the contents from stdin.
  20. The file format of the file to read cookies from should be plain HTTP headers
  21. (Set-Cookie style) or the Netscape/Mozilla cookie file format.
  22. The file specified with --cookie is only used as input. No cookies will be
  23. written to the file. To store cookies, use the --cookie-jar option.
  24. If you use the Set-Cookie file format and do not specify a domain then the
  25. cookie is not sent since the domain will never match. To address this, set a
  26. domain in Set-Cookie line (doing that will include sub-domains) or preferably:
  27. use the Netscape format.
  28. This option can be used multiple times.
  29. Users often want to both read cookies from a file and write updated cookies
  30. back to a file, so using both --cookie and --cookie-jar in the same command
  31. line is common.