title: Codeigniter object in session?
body: <p>I'm starting out with CI and there's something I don't understand.
  I'm writing this login page and I'd like to add the users object to the session. How do I do that? The user object comes from my user model..
  For a new instance I write:</p>
  
  <pre><code>$this-&gt;load-&gt;model('user_model', 'user');
  </code></pre>
  
  <p>but this won't work:</p>
  
  <pre><code>$this-&gt;session-&gt;set_userdata('userobject', $this-&gt;user);
  </code></pre>
  
  <p>Any ideas how this is done?</p>