title: Codeigniter - unserialize session not working outside application folder
body: <p>I'm trying to read the session value outside the application folder but it's not working.</p>
  
  <p>My code:</p>
  
  <pre><code>if (!empty($_COOKIE['ci_session'])) {
          $uid = unserialize($_COOKIE['ci_session']);
        //passes till here
          if(!empty($uid['uid'])){
              //doesn't get to here
              $userid = $uid['uid'];
          }
      }
  </code></pre>
  
  <p>That doesn't work and I have no idea why.</p>
  
  <p>I have tried this and it works but I can't use this I can only use the above one:</p>
  
  <pre><code>   ob_start();
  include('index.php');
  ob_end_clean();
  $CI =&amp; get_instance();
  $CI-&gt;session-&gt;userdata('first_name');
  </code></pre>
  
  <p>Do I need to go to my codeigniter config file to allow something? I don't know</p>