从php ,session_set_save_handler 的_sess_read方法把session data值定义赋值给类属性不成功,后来改用全局变量赋值成功
function _sess_read($sesskey)
{
$row = $this->db->getRow(‘SELECT data, expiry, is_overflow FROM ‘ . $this->session_table . " WHERE sesskey = ‘" . $this->session_id . "‘");
if (!empty($row))
{
if ($row[‘is_overflow‘])
{
$row = $this->db->getRow(‘SELECT data, expiry FROM ‘ . $this->session_data_table . " WHERE sesskey = ‘" . $this->session_id . "‘");
}
}
else
{
$this->insert_session();
}
//用面向对象赋值给属性未能成功,sessionHandle估计不支持,改用全局参数获得online_data
$GLOBALS[‘online_data‘] = $row;
return isset($row[‘data‘]) ? $row[‘data‘] : ‘‘;
}
时间: 2024-10-30 12:26:56