First of all, I want to make clear that I've tried many different ways and read quite a lot of articles about this, but none worked completely.
I've got to the point, where I successfully get the cookies by cURL, but when I try to actually use them, it simply fails and says that I'm being redirected.
The point, where I want to get, is that I just want to log in, retrieve the data from my profile and then do stuff with it...
Here's where I am right now (it just saves the correct cookies, but doesn't return back MY post-login page):
$url="https://myschool.managebac.com/sessions/";
$postdata = "login=myname@myschool.com&password=password&commit=Sign-in&remember_me=1";
$cr = curl_init();
curl_setopt($cr, CURLOPT_URL, $url);
curl_setopt($cr, CURLOPT_POST, TRUE);
curl_setopt($cr, CURLOPT_HEADER, TRUE);
curl_setopt($cr, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($cr, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($cr, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($cr, CURLOPT_COOKIEJAR, 'cookie.txt');
$header = curl_exec($cr);
curl_close($cr);
$cr2 = curl_init();
curl_setopt($cr2, CURLOPT_URL, 'https://myschool.managebac.com/');
curl_setopt($cr2, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($cr2, CURLOPT_HEADER, TRUE);
curl_setopt($cr2, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($cr2, CURLOPT_COOKIEFILE, 'cookie.txt');
$result = curl_exec($cr2);
curl_close($cr2);
I hope that there actually is a possible way, because Managebac is not that used application (mainly for IB students), but it would help me a great deal if I got this working.
I'm glad for every and each answer.