Remote Login to Webmin using PHP/cURL

Hey,

I’m wondering if anyone has tried this? I keep getting “your server does not support cookies” back… here’s my cURL code:

$ch = curl_init();

$headers[] = “Connection: Keep-Alive”;

curl_setopt($ch, CURLOPT_URL, “https://:10000$server-ip/session_login.cgi?user=$user&pass=$pass”);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[‘HTTP_USER_AGENT’]);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_COOKIEJAR, “/path/to/tmp/test_cookie.txt”);

curl_setopt($ch, CURLOPT_REFERER, “https://:10000$server-ip/”);

$r = curl_exec($ch);

curl_close($ch);

die($r);