Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • Thanks. Is --cookie without a real file only used when you're using the -L option ("follow through 3XX redirects")? Commented Jan 30, 2019 at 23:45
  • 1
    " if you don't accept their cookies". how can you make curl not accept cookies? Commented Jan 30, 2019 at 23:51
  • 1. -L is a case where curl does multiple requests in a single invocation; other case is where you're using curl with multiple urls. 2. by not using any --cookie option as I did in the 2nd example. "Accepting cookies" means sending them back in requests, in a Cookie: header. Commented Jan 30, 2019 at 23:59
  • If by "record" you mean copying the string somewhere so it could be sent back with subsequent requests, then, yes, you'll have to "record" it. The server doesn't know or care what you doing with it, as long as you're sending it back, so it could keep state and track you through multiple requests. This is already quite offtopic, but there's another method you could keep state in HTTP -- by encoding it in the url. The downside of that vs. cookies is that it's too obvious to the user ;-) Commented Jan 31, 2019 at 1:57
  • I second the question of how to make curl not accept cookies at all. Wget has the "--no-cookies" flag. Is there an equivalent in curl? Unless perhaps not accepting cookies is the default in curl. Commented Apr 1, 2020 at 15:58