title: Want to store multiple id's (dynamically) in session array of Codeignitor 2.x
body: <p>Need to store multiple id's dynamically in codeignitor session array. Array push seems to be not working. Am able to add only one id. Any help?</p>
  
  <p>Code is below:</p>
  
  <pre><code>$internships_array['internships'][] = $internship_result['id'];
  if (empty($this-&gt;session-&gt;userdata('internships')) || sizeof($this-&gt;session-&gt;userdata('internships')) &lt; 1) {
      $this-&gt;session-&gt;set_userdata($internships_array);
  } else {
      array_push($this-&gt;session-&gt;userdata('internships'), $internship_result['id']);
  }
  </code></pre>