speedphp里的session每次都是生成新的session?

#1 jy00504445

class login extends spController
{
function index(){
  $this->pnfConfig = $GLOBALS['pnfConfig'];
  $this->test=formhash();
  $_SESSION["UID"]="1";
  echo session_id();
}

function check(){
  echo $_SESSION["UID"];
  echo session_id();
}
}

同一个控制器的,可是index跳转到check的时候 就不是原来的session了,我要怎么才能读回index中存的$_SESSION["UID"]数据?

2010-12-15 17:24:47

#2 jake

sp不会修改你的session内容的,试试不要调用session_id()函数看看,这个函数是会改变session的session_id()详情看
http://php.net/manual/en/function.session-id.php

2010-12-15 18:00:09