Gentlemen,
Made an earlier post that was pretty long and no answers, realized I can isolate the problem so heres a MUCH simpler situation:
Here's page one:
session_start();
for($i=1;$i<=50;$i++){
set_time_limit(11);
sleep(10);
echo 'Pass '.$i.', slept for 10 seconds<br>';
}
Here's page two:
session_start();
echo 'Session successfully started!';
The problem is, I can't call page two while page one is running. And page one is pretty bare bones, agreed? There seems to be a locking issue on the session file. Any way around this?
What makes me think this is:
1. I can still access any other session file on another domain with session_start();
2. I can start a session with a different id (=different file) on that domain.
Please help, I can do some really cool things if this is solved!!!
Thanks,
Samuel
[edited: --------]
I found a workaround to this but it's a hack. Page one:
session_start();
$job=1;
for($i=1;$i<=100;$i++){
set_time_limit(15);
sleep(10);
echo 'Pass '.$i.', slept 10<br>';
if(file_exists('/tmp/sess_'.$PHPSESSID.'-stop-'.$job)){
echo 'got file!<br>';
$stopOrders=trim(implode('',file('/tmp/sess_'.$PHPSESSID.'-stop-'.$job)));
echo 'contents: '.$stopOrders.'<br>';
if($stopOrders==1){
echo 'stop process from outside trigger<br>';
break;
}
}
}
Page two:
//can't start session so we get session id this way
$job=1;
$fp=fopen('/tmp/sess_'.$_COOKIE['PHPSESSID'].'-stop-'.$job,'w');
fwrite($fp,'1');
fclose($fp);