title: Codeigniter modifying session data
body: <p>I store few data in session as the following:</p>
  
  <pre><code>$session_data = array("uid" =&gt; "test user", "loged_in" =&gt; true);
  
  $this-&gt;session-&gt;set_userdata($session_data);
  </code></pre>
  
  <p>To modify the "uid" I tried</p>
  
  <pre><code>$uid = array("uid" =&gt; "New user");
  $this-&gt;session-&gt;set_userdata($uid);
  </code></pre>
  
  <p>It did not work so I tried   </p>
  
  <pre><code> $this-&gt;session-&gt;set_userdata("uid","New user");
  </code></pre>
  
  <p>It also did not work. Cant find any useful stuff on google. Please help how can I change values in the session??</p>