title: Why doesn't cookie work in CodeIgniter?
body: <p>I use this function to add cookie and it adds perfectly as I can see in browser options.</p>
  
  <pre><code>function login($username,$password){
  
      $cookieUsername = array(
          'name'   =&gt; 'user',
          'value'  =&gt; md5($username),
          'expire' =&gt; time()+1000,
          'path'   =&gt; '/',
          'secure' =&gt; TRUE
      );
  
      $cookiePassword = array(
          'name'   =&gt; 'pass',
          'value'  =&gt; $password,
          'expire' =&gt; time()+1000,
          'path'   =&gt; '/',
          'secure' =&gt; TRUE
      );
  
      $this-&gt;input-&gt;set_cookie($cookieUsername);
      $this-&gt;input-&gt;set_cookie($cookiePassword);
  
  }
  </code></pre>
  
  <p>I am unable to get back the cookie from this function:</p>
  
  <pre><code> echo $this-&gt;input-&gt;cookie('user');
  </code></pre>
  
  <p>Please help - how can I get cookie back from CodeIgniter?</p>