4
votes

G'day

I am not getting Session value in IE browser of a Cakephp(2.2.0) project.Please find the below scenario and suggest me what need be done.

Scenario - 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']);   
}

    }

Scenario - 2

// In this controller i am getting session value

class SecondController extends AppController {

        public function index(){
          pr($this->Session->read()); // i am getting same session  value in this action.
        }

}

Scenario - 3

  1. In this action i am have one form.I am getting same session value in this page, before posting the form.
  2. Once i post the form and print same session array in the first line of action but result is empty in IE broswer.
  3. Its working fine in other browser like Mozilla, Chrome and Safari

    class FinalController extends 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   
    
    }
    

    }

Please help me out for this above issue. I do appreciate for advance help. Thank you.

2

2 Answers

1
votes

Try PHP session if cakephp session is not working. You can use @session_start() method in AppController.php.

Sometimes I also faced this issue but if we do like this its working proper.

0
votes

Try this one.

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

Thanks