title: Where to set session in Codeigniter?
body: <p>I'm reading the Codeigniter 2.2 tutorial and I am not clear on how to use sessions for logging in. </p>
  
  <p>Say I have a login.php, which checks user data with the database. Then if its ok then I should set the session in a controller?</p>
  
  <pre><code>  $this-&gt;load-&gt;library('session');
  </code></pre>
  
  <p>And then in say admin.php page I should check if session exists by? :</p>
  
  <pre><code> $this-&gt;session-&gt;user_data('item'); ??
  </code></pre>
  
  <p>Or how do I check if the person is logged in?</p>
  
  <p>Thank you</p>