title: Codeigniter - check if user is logged and exists (it's a real user)
body: <p>I'm trying to set session data for users when they log in to my website.</p>
  
  <p>So if the user exists in db, I set a session data like : <code>$this-&gt;session-&gt;set_userdata('user_exists','1');</code></p>
  
  <p>Now every time i want to check if user exists and is logged i do:</p>
  
  <pre><code>if($this-&gt;session-&gt;userdata('user_exists')){
   //do somenthing for logged user
  }
  </code></pre>
  
  <p>Now I'm wondering if this means that user is logged and exists in the database since he logged and I set him a session param, is this true? Or I'll get security problems?</p>
  
  <p>NB: I'm using session database</p>