Я вызываю invoke.php, используя CURL из curl.php с моего локального хоста.В invoke.php я храню некоторые данные в сессии.Но когда я пытаюсь получить доступ к этим данным сеанса из curl.php, не получаю эти данные сеанса.Как получить эти значения?
Содержимое curl.php
`include_once ('session.php');
$ handles = array ();
$ urlArray = array ('http://localhost/invoke.php');
foreach ($ urlArray as $ url) {
// create a new single curl handle
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
// add this handle to the multi handle
curl_multi_add_handle($mh,$ch);
// put the handles in an array to loop this later on
$handles[] = $ch;
}
// выполнить мульти дескриптор
$ running = null;
do {
curl_multi_exec($mh,$running);
// added a usleep for 0.25 seconds to reduce load
usleep (250000);
} while ($ running> 0);
// получить содержимое URL (если есть)
for ($ i = 0; $ i
{
// get the content of the handle
// $ output. = curl_multi_getcontent ($ handles [$ i]);
// remove the handle from the multi handle
curl_multi_remove_handle($mh,$handles[$i]);
}
echo SessionHandler :: getData ('DATA'); `
Содержимое файла invoke.php
include_once ('session.php');
echo SessionHandler :: setData ('DATA', 'HELLO WORLD');