1
我在cakephp應用程序中使用了會話,但它看起來像我設置的會話不在我正在使用的各種控制器之間共享。所以可以說我有在cakephp中的多個控制器中沒有讀取會話
PagesController
public $components = array('Email', 'Session', 'RequestHandler', 'Cookie');
//this is pages/home
public function home(){
$this->Session->write("bunny", "123456");
debug($this->Session->read("bunny"));
}
PersonController
public $components = array('Email', 'Session', 'RequestHandler', 'Cookie');
//this is person/index
public function index(){
debug($this->Session->read("bunny");
}
當我去到url http://domian.org/person/index,即調試線爲空。不應該打印出「123456」?
您的意思是有'function'在該行'公用分類指數()'? – Dave 2013-03-04 21:09:56
我已經添加了。謝謝。我仍然有相同的錯誤。 – gerl 2013-03-05 14:55:12
它確實調試'null',還是不調試任何東西? – Dave 2013-03-05 17:04:43