I have a strange problem. I am using javascript ajax (I used jquery). Now the script:
One ajax call invokes a php script, which is basically a lengthy process and sets some session variables.
Later at a few intervals (say, every 2 seconds) I start another ajax call to check the session variables to find out when the process (first run php script) is complete.
The first php script retrieves data from the database and inserts it into a file. In each sample, I count the cycle number and save it in a session variable to save some kind of tracking record. How;
$i=0;
$_SESSION['time']=date('m-d-Y H:i:s');
while(...)
{
ini_set('session.use_only_cookies', false);
ini_set('session.use_cookies', false);
ini_set('session.use_trans_sid', false);
ini_set('session.cache_limiter', null);
session_start();
$_SESSION['tracksatus']="loop number : ".$i." time is :"$_SESSION['time'];
session_write_close();
$i++;
......
......
}
Another php script that I call through setInterval
ajax just does:
echo $_SESSION['trackstatus']
The set ajax interval returns me:
loop number 1 time is m-d-Y H:i:s
loop number 5 time is m-d-Y H:i:s
loop number 8 time is m-d-Y H:i:s
......
loop number 1 time is m-d-Y H1:i1:s1
.....
H: i: s H1: i1: s1
, , php script . 12 . - ( , , .... , ).
, ?
, , .
, , , , , . .