title: Curl CLI - Saving Cookies PLUS login
body: <p>The Manual at <a href="http://curl.haxx.se/docs/manual.html" rel="nofollow">http://curl.haxx.se/docs/manual.html</a> is a bit "quick" and I didn't get how to do do this.</p>
  
  <p>I need to save all cokies (and sessions cookies) and then login to a site via CLI.</p>
  
  <p>Till here, it seams it works (saving and reading):</p>
  
  <p><code>curl -b cookies -c cookies <a href="http://www.theknot.com" rel="nofollow">http://www.theknot.com</a></code></p>
  
  <p>Tried to use NETRC (a file ".netrc" with user and password in the format: machine curl.haxx.se login iamdaniel password mysecret):</p>
  
  <p><code>curl -n -L -b cookies -c cookies <a href="http://global.theknot.com/join/memberlogin.aspx" rel="nofollow">http://global.theknot.com/join/memberlogin.aspx</a></code></p>
  
  <p>But it does not do the magic:</p>
  
  <p><code>curl -L -n -b cookies -c cookies <a href="http://www.theknot.com/wedding-dress/mon-cheri-bridals/211249?src=par" rel="nofollow">http://www.theknot.com/wedding-dress/mon-cheri-bridals/211249?src=par</a></code></p>
  
  <p>For it keeps redirecting to the login page...</p>
  
  <p>Does anybody has already been throught this? Thanks.</p>