天儿真好
我没有在Cakephp(2.2.0)项目的IE浏览器中获得Session值。请找到以下场景并建议我需要做什么。
情景 - 1
// Here i am storing session value to SessionHold array as follows.
class TestController extends AppController {
public function index(){
$this->Session->write('SessionHold.unique_id', $uniqe_id);
$this->Session->write("SessionHold.zipcode", $this->request->data['Test']['zipcode']);
$this->Session->write("SessionHold.business", $this->request->data['Test']['business']);
}
}
情景 - 2
//在这个控制器中我得到会话值
class SecondController extends AppController {
public function index(){
pr($this->Session->read()); // i am getting same session value in this action.
}
}
情景 - 3
它在其他浏览器中运行良好,如Mozilla,Chrome和Safari
类FinalController扩展AppController {
public function index(){
pr($this->Session->read()); // getting value before posting the form
**pr($this->Session->read()); exit;** // not getting the session value after posting the form
}
}
请帮助我解决上述问题。我非常感谢提前帮助。谢谢。
答案 0 :(得分:1)
如果cakephp会话不起作用,请尝试PHP会话。您可以在AppController.php中使用@session_start()方法。
有时我也遇到过这个问题,但是如果我们这样做的话,那就是正常工作。
答案 1 :(得分:0)
试试这个。
<?php
// try this one...
class SecondController extends AppController {
public function index(){
pr( $this->Session->read('SessionHold') );
}
}
由于