When you use curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); does that make it so that when you receive headers for set cookie that it automatically puts the cookie information in the text file? I can't seem to find informative documentation for CURLOPT_COOKIE at all, so I am basically really confused at this point.