title: Saving Cookie with CURL on linux
body: <p>We use CURL to automate some administrative tasks on a web application that uses SSO cookie for all the sites on the domain. Recently, there was a change in the authentication system on the application that we had been automating with. That's fine. We changed the CURL script to conform to the new authentication. We are able to get cookies and save to the jar. </p>
  
  <p>The problem is the way the cookie is saved. I looked at how the headers in Google Chrome and Mozilla Firefox and the response headers are the same that I see in CURL. However the cookie in the cookie jar isn't saving the cookie in a way that it can be sent to the subsites in the Domain.</p>
  
  <p>The CURL Example is as follows:</p>
  
  <blockquote>
    <p>curl -c mycookie "<a href="https://login.example.com" rel="noreferrer">https://login.example.com</a>" -d loginUID=myusername -d loginPWD=mypassword</p>
  </blockquote>
  
  <p>The format it's saving is:</p>
  
  <blockquote>
    <p>login.example.com   FALSE   /   TRUE   SSOCookie   automatedvalue</p>
  </blockquote>
  
  <p>The cookie will be consumed by the subsites if we manually change the cookie to:</p>
  
  <blockquote>
    <p>.example.com   TRUE   /   TRUE   SSOCookie   automatedvalue</p>
  </blockquote>
  
  <p>I'm not sure why the cookies would be saved as such. </p>
  
  <p>Does anyone know what would cause CURL to save the cookies as such? Or if there is a work around other than manually/scripting a change to be used for the entire domain?</p>
  
  <p>Note: When I do a -v on setting the cookies. It says *Replased cookie SSOCookie "uniquecookieid" for domain login.cat.com</p>
  
  <p>Thank you,</p>