我現在有一個彗星頁,如果我打電話session_start
頂部則會話凍結,我的工作圍繞做的是這樣的:我怎麼會不調用在session_start
function getTables($sessionID = null){
if(!isset($this->output)){
$this->output = array();
}
if(!isset($this->output[$this->sessID])){
$this->output[$this->sessID] = array();
}
$hostname = php_uname("n");
$sess_ini = session_save_path();
chdir($sess_ini);
if(false === ($save = @file_get_contents("sess_$this->sessID"))){
$cwd = getcwd();
chdir($this->location);
return (isset($this->returnJSON[$this->sessID])?$this->returnJSON[$this->sessID]
:json_encode(array(
'sess_local'=>"$sess_ini/sess_$this->sessID",
'save'=>$save,
'hostname'=>$hostname,
'cwd'=>$cwd,
'reg_local'=>$this->location,
)
)
);
}
chdir($this->location);
//session_id($sessionID);
$sessions = explode("|",$save);
$_SESSION['all'] = array();
foreach($sessions as $key=>$sess){
if(trim($sess)=='all' && isset($sessions[$key+1])){
$_SESSION['all'] = unserialize(trim(urldecode($sessions[$key+1])));
break;
}
}
...
有一個更好的方式讓我變得會話變化多數民衆贊成不進入會議文件?
我認爲你需要解決和解決根本問題(爲什麼'session_start()'讓事情凍結)而不是 – 2011-04-21 19:19:18
@詹姆斯C這是我的prev問題....它解決了從session_start彗星的無限幀 - http://stackoverflow.com/questions/5553830/how-do-irefresh-the-session-in-comet – Neal 2011-04-21 19:21:34
@詹姆斯,這是由於事實,有限制在PHP與有兩個會話目前有相同的ID – Neal 2011-04-21 19:28:01