Yeah, it was still causing me issues too. I found it to work sometimes and other times not. I have had a bug report open for a long time but they are going no where so I just bit the bullet today and wrote my own php wrapper.
The following script will call your login application first and save the php session cookies to a local file. Then it calls the real application using the cookies that were set in your login app. Just set this up on your server and then call this wrapper script from cron.
<?php
// Cron wrapper for scriptcase
// Usage: cron.php?appname=** name of app to call **&var1=123&var2=123
// Example: cron.php?appname=email_daily&send=1
// Author: Rob Perrett
// Version 1.0
// 19-08-2019
// The base URL of production
$base_url = "https://myapp.com/";
// Name of your login application
$login = $base_url . "login/login.php";
// Get the application name
if (empty($_GET["appname"])) die("No application name set");
$app_name = htmlspecialchars($_GET["appname"]);
// Get all incoming variables
$get_string = htmlspecialchars($_SERVER["QUERY_STRING"]);
$app_url = $base_url . $app_name . "/" . $app_name . ".php?".$get_string;
echo curl_download($login);
echo curl_download($app_url);
function curl_download($Url){
echo $Url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
//curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
$http_headers = array(
'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2',
'Accept: */*',
'Accept-Language: en-us,en;q=0.5',
'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Connection: keep-alive'
);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $http_headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_VERBOSE, true);
$response = curl_exec($ch);
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$body = substr($response, $header_size);
curl_close($ch);
return $body;
}
?>