title: How to retrieve a particular session value in codeigniter?
body: <p>I would set a session value in codeigniter</p>
  
  <pre><code>$sess_array = array(
  'id' =&gt; $row-&gt;Login_Id,
  'username' =&gt; $row-&gt;Login_Name,
  'postid'=&gt; $row-&gt;Fk_Post_Id,
   );
  $CI-&gt;session-&gt;set_userdata('logged_in', $sess_array);
  </code></pre>
  
  <p>Then how to retrieve a particular (say - id) session value . I tried these</p>
  
  <pre><code>$createdby=$this-&gt;session-&gt;userdata('id');
  $createdby=$this-&gt;session-&gt;userdata($logged_in['id']);
  </code></pre>
  
  <p>but fails.</p>