Get "Cookie" from https site by curl

14,148

Try this out:

curl -c - '<website>'
  • -c flag is to retrieve the cookie
Share:
14,148

Related videos on Youtube

SHW
Author by

SHW

Linux System Integrator by profession

Updated on September 18, 2022

Comments

  • SHW
    SHW over 1 year

    I would like to have cookie of a HTTPS site. I do have credential and certificate to access given site.

    If I access site from chrome/firefox then I can easily extract cookie but what is the way to have this cookie from command line by using curl,wget or similar CUI-based tools ?

  • SHW
    SHW almost 7 years
    curl: no URL specified! curl: try 'curl --help' or 'curl --manual' for more information
  • Matej Vrzala M4
    Matej Vrzala M4 almost 7 years
    What command did you use? Can you copy and the paste the exact command?
  • SHW
    SHW almost 7 years
    I used the same command as you mentioned by replacing '<website>' by desired URL.
  • SHW
    SHW almost 7 years
    I tried that too. Then message appears as "<html><head><title>Object moved</title></head><body>"
  • Matej Vrzala M4
    Matej Vrzala M4 almost 7 years
    Can i try testing with the URL your are plugging in? Or is this a private site?
  • SHW
    SHW almost 7 years
    This is private site. Or more precisely, it's in LAN only.
  • Matej Vrzala M4
    Matej Vrzala M4 almost 7 years
    Ok, I am testing google's site. I am making sure to plug in http and www in front of google.com