title: Problems with cookies / MAMP / CodeIgniter
body: <p>I'm having a problem with reading cookies on localhost, using MAMP and Codeigniter.</p>
  
  <p>I'm trying to ude a cookie to authenticate acess to an admin area. I can set the cookie (I see it on my browser - Chrome) but i'm not able to read it after doing that to grant the acess. I've already tried lots of configurations, but none works. I really need some help on this.</p>
  
  <p>Those are the essencial parts of my code:</p>
  
  <p>Here I set the cookie</p>
  
  <pre><code>$cookie = array(
      'name'   =&gt; 'login',
      'value'  =&gt; 'true',
      'expire' =&gt; '0',
      'secure' =&gt; TRUE
  );
  set_cookie($cookie);
  </code></pre>
  
  <p>Here I redirect the user to login page if there is no cookie and to control panel if the cookie is set</p>
  
  <pre><code>function login_redirect() {
      $this-&gt;load-&gt;helper('cookie');
      if (uri_string() == 'admin/controlpanel') {
          if ($this-&gt;input-&gt;cookie('login')) {
          } else {
              redirect('admin/');
          }
      }
      if (uri_string() == 'admin') {
          if ($this-&gt;input-&gt;cookie('login')) {
              redirect('admin/controlpanel');
          }
      }
  }
  </code></pre>
  
  <p>OBS: all this code is in the admin_model</p>
  
  <p>Any tips?</p>
  
  <p>Thanks and sorry about my english. I hope I've made myself clear.</p>