Hello and thank you for helping me with my project. So I have successfully created a script to log into my my chat, but when I try to execute the second part of the curl it says I need to log in to post a message. The first curl works by it self and logs in. So how can I stay logged in with the first curl and then move to the second part to post a message?
/* ===================================================================
login set cookie
====================================================================== */
$clogin = curl_init();
curl_setopt ($clogin, CURLOPT_URL, $Login_URL);
curl_setopt ($clogin, CURLOPT_REFERER, $Referer);
curl_setopt ($clogin, CURLOPT_USERAGENT, $Agent);
curl_setopt ($clogin, CURLOPT_COOKIEJAR, $Cookie_Location);
curl_setopt ($clogin, CURLOPT_COOKIEFILE, $Cookie_File);
curl_setopt ($clogin, CURLOPT_POST, 1);
curl_setopt ($clogin, CURLOPT_POSTFIELDS, $Login_Data);
curl_setopt ($clogin, CURLOPT_RETURNTRANSFER, 1);
curl_exec ($clogin);
/* ===================================================================
post message
====================================================================== */
$cpost = curl_init();
curl_setopt ($cpost, CURLOPT_URL, $Posting_URL);
curl_setopt ($cpost, CURLOPT_REFERER, $Login_URL);
curl_setopt ($cpost, CURLOPT_USERAGENT, $Agent);
curl_setopt ($cpost, CURLOPT_COOKIEJAR, $Cookie_Location);
curl_setopt ($cpost, CURLOPT_COOKIEFILE, $Cookie_File);
curl_setopt ($cpost, CURLOPT_POST, 1);
curl_setopt ($cpost, CURLOPT_POSTFIELDS, $Posting_Data);
curl_setopt ($cpost, CURLOPT_RETURNTRANSFER, 1);
curl_exec ($cpost);
curl_close($cpost);