• Mac OS X,  Mac Security

    Cookie Management With Curl

    To tell curl that you can read and write cookies, first we’ll start the engine using an empty cookie jar, using the -b option, which always reads cookies into memory: curl -b newcookiejar https://krypted.com If your site can set cookies you can then read them with the -L option curl -L -b newcookiejar https://krypted.com The response should be similar to the following: Reading cookies from file Curl also supports reading cookies in from the Netscape cookie format, used by defining a cookies.txt file instead: curl -L -b cookies.txt https://krypted.com If the server updates the cookies in a response, curl would update that cookie in memory but unless you write something…