0

I used the command below to download cookie using CURL in bash. How do I use this file (cookies.txt) to access the page?

curl -u username --cookie cookies.txt --cookie-jar cookies.txt https://example.com
xhienne
  • 17,075
  • 2
  • 52
  • 68
Koshur
  • 1,319
  • 4
  • 21
  • 36

1 Answers1

1

Your curl command is correct. With the --cookie cookies.txt option, you reuse the cookies that were previously saved with the --cookie-jar cookies.txt option.

With wget:

wget --load-cookies cookies.txt --save-cookies cookies.txt ...
xhienne
  • 17,075
  • 2
  • 52
  • 68
  • It only download the cookies.txt. I am not able to see the output of curl. Nothing is printed to stdout. – Koshur Mar 21 '17 at 14:27
  • Update your question with the precise URL your are probing so that we can reproduce your problem and see what happens. BTW, cookies.txt is not downloaded at all, it a local file that is updated with the cookies that come along with the content you are downloading. – xhienne Mar 21 '17 at 14:29