2013-10-18 1 views
4

G'dayCakePHP의 세션 값이 IE 브라우저에서 점점되지

나는 아래의 시나리오를 찾아서 할 필요는 걸 제안 CakePHP의 (2.2.0) project.Please의 IE 브라우저에서 세션 값을 받고 있지 않다 .

시나리오 - 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

  1. 을 나는 하나의 양식을 가지고있다. 나는 똑같은 sessio를 얻고있다. 양식을 게시하기 전에이 페이지에서 n 값을 입력하십시오.
  2. 일단 내가 양식을 게시하고 첫 번째 작업 줄에 동일한 세션 배열을 인쇄하지만 결과는 IE broswer에서 비어 있습니다. 모질라, 크롬과 사파리

    클래스 FinalController 같은 다른 브라우저에서

  3. 그 작업 벌금

이 위의 문제에 대해 저를 도와주세요 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 

} 

}을 확장합니다. 나는 사전 도움을 주셔서 감사합니다. 고맙습니다.

답변

1

cakephp 세션이 작동하지 않는 경우 PHP 세션을 사용해보십시오. AppController.php에서 @session_start() 메소드를 사용할 수 있습니다.

가끔 나는 또한이 문제에 직면하지만 우리가 이것을 좋아한다면 제대로 작동합니다.

+0

나는 당신의 문제를 감사드립니다. 나는 위의 방법으로 시도했지만 결과는 이전과 동일합니다. – Neil

+0

우리는 하나의 PHP inbuilt 메소드 @ob_start()를 가지고 있는데 이것을 AppController.php 파일에서 사용합니다 .. – Pank

0

시도해보십시오.

<?php 
// try this one... 
class SecondController extends AppController { 
    public function index(){ 
     pr($this->Session->read('SessionHold')); 
    } 
} 

감사

+0

이 값을 얻지 만 IE8 만 문제가됩니다. – Neil