title: Is there a way of passing a multidimensional array into a session?
body: <p>I've been trying with this issue all morning. When i load the function which sets the array directly, and remove the redirect, it works fine. All of the data in both levels of the array is there. When i add back in the redirect, the function redirects and the second level of the array is removed. Leaving just the first. So the Session is setting, but it's dropping the data from the session for some reason.</p>
  
  <p><strong>The Function Which controls the array and redirect</strong></p>
  
  <pre><code>public function test(){
          $i=$_GET['i'];
          $this-&gt;construct_data();
          redirect('view/name?i='$i);
      }
  public function construct_data(){
      $i=$_GET['i'];
      list($array1)=$this-&gt;array1($i);
      list($array2)=$this-&gt;array2($i);
      list($array3)=$this-&gt;array3($i);
      list($array4)=$this-&gt;array4($i);
      list($array5)=$this-&gt;array5($i);
      list($array6)=$this-&gt;array6($i);
      $container= array(
              'array1'=&gt;$array1,
              'array2'=&gt;$array2,
              'array3'=&gt;$array2,
              'array4'=&gt;$array4,
              'array5'=&gt;$array5
      );
      $this-&gt;session-&gt;set_userdata('construct',$container);
  }
  </code></pre>
  
  <p><strong>The view</strong></p>
  
  <pre><code>$data = $this-&gt;session-&gt;userdata('construct');
  var_dump($data);
  </code></pre>
  
  <p>The var_dump in the view returns all of the first level of container, array 1 through 5. But it doesn't contain any of the data inside of the functions that are called. it returns $data['array1'].</p>
  
  <p>Now if i were to put the var_dump inside the test function instead of redirect, the data is returned as it should be, $data['array1']['array1item'].</p>
  
  <p>Let me know if this was unclear. Also the names of variables and functions were changed to maintain anonymity.</p>