Codeigniter: Set_uderdata returning NULL
<p>Is this normal that <code>$this-&gt;session-&gt;set_userdata()</code> is returning null? My controller is this.</p>

<pre><code>function set_supplier() {

    //UNSET THE OLD DATA 
    if($this-&gt;session-&gt;userdata('supplier_data')) {
        $this-&gt;session-&gt;unset_userdata('supplier_data');
    }

    $supplier_id = $this-&gt;encrypt-&gt;decode($this-&gt;input-&gt;post('supplier'));

    $sess_array = array();           
    $sess_array = array(
             'id' =&gt; $supplier_id                
     );

    $process = $this-&gt;session-&gt;set_userdata('supplier_data', $sess_array);

    if($process) {
          //SUCCESS
            $this-&gt;session-&gt;set_flashdata('success', 'You have set the supplier!');
            redirect($_SERVER['HTTP_REFERER'], 'refresh');
         } else {
          //ERROR
            $this-&gt;session-&gt;set_flashdata('error', 'Oops! An Error has Occured!');
            redirect($_SERVER['HTTP_REFERER'], 'refresh');              
    }

}
</code></pre>

<p>I simply added <code>var_dump($process);</code> to show what's going on and it is showing <code>NULL</code></p>

<p>What I want to happen is to return a message when <code>$process</code> is true.</p>