title: Update session data not working - CodeIgniter
body: <p>My problem is simple: I have in my table a field called <code>credit</code>.</p>
  
  <p>I want to add 1 <code>credit</code> to a connected user, so I update the field <code>credit</code>. The update works well, but when I want to display the <code>credit</code>, the addition has not been done.</p>
  
  <p>Example: the user <code>Joe</code> has logged with 2 <code>credit</code>. I add him 1 <code>credit</code>. It works in the database but not on the screen. The problem is solved if he disconnects and reconnects. </p>
  
  <p>So, I'd like to know how can i update session data without disconnecting</p>
  
  <p>Controller 'LoginArea'</p>
  
  <pre><code>
  $this-&gt;load-&gt;library('session');
  $dataUser = array(
      'id' =&gt;     $ligneBDD-&gt;{'id_user'},
      'name' =&gt;   $ligneBDD-&gt;{'name'},
      'credit' =&gt; $ligneBDD-&gt;{'credit'}
  );
  
  // i store id, name and credit in my session
  $this-&gt;session-&gt;set_userdata('data', $dataUser);
  
  
  </code></pre>
  
  <p>And this is my update :</p>
  
  <pre><code>$update= $this-&gt;User_model-&gt;update(array(
                                      'credit' =&gt; $userConnected['credit'] - 1
                                          ),  
                                          array(
                                          'id_user' =&gt; $userConnected['id'])
                                          );
  </code></pre>