title: why is CURLOPT_COOKIEJAR needed when CURLOPT_COOKIESESSION set default
body: <p>I have a curl script that is used to remote control a login a (government) website. The website has a government-wide login system that uses 5 redirects over various servers. I found the login works when I set CURLOPT_COOKIEJAR, however I don't understand why this is necessary.</p>
  <p><a href="http://www.php.net/manual/en/function.curl-setopt.php" rel="nofollow noreferrer">http://www.php.net/manual/en/function.curl-setopt.php</a> states:</p>
  <blockquote>
  <p>CURLOPT_COOKIESESSION</p>
  <p>TRUE to mark this as a new cookie &quot;session&quot;. It will force libcurl to
  ignore all cookies it is about to load that are &quot;session cookies&quot; from
  the previous session. By default, libcurl always stores and loads all
  cookies, independent if they are session cookies or not. Session
  cookies are cookies without expiry date and they are meant to be alive
  and existing for this &quot;session&quot; only.</p>
  </blockquote>
  <p>So it would appear the default behavaiour is to retrieve and resend all cookies?</p>
  <p>I would try to understand why my trial and error method was successful</p>