title: php - empty() function for cookies is not working
body: <p>I would like to show a popup message when users are coming for the first time on my website. The problem is that the popup is always coming back when I refresh the page. I did it this way:</p>
  
  <p>If a user comes on the website, I have an PHP function that checks if he has a cookie named <code>"first_time"</code> set.</p>
  
  <pre><code>&lt;?php if (empty($_COOKIE["first_time"])) {
   echo 'yes';
  } else {
   echo 'no';
  }
  </code></pre>
  
  <p>As you can imagine, there is always <code>'yes'</code> message. </p>
  
  <p>When I go to <code>Applications -&gt; Cookies</code> on Chrome I find the cookie <code>"first_time"</code> with value <code>"no"</code>. So I understand that the cookie <code>"first_time"</code> is not empty and the echo message should be <code>"no"</code>. </p>
  
  <p>I tried to remove the cache also but doesn't seem to work.</p>
  
  <p>var_dump($_COOKIE) show me this:</p>
  
  <pre><code>array(10) { ["first_time"]=&gt; string(2) "no"...
  </code></pre>
  
  <p>The cookie is set this way when a user clicks to close the popup:</p>
  
  <pre><code>function remove_popup(){
    document.cookie = 'first_time=no; expires=Sun, 28 Feb 2030 00:00:00 UTC';
  }
  </code></pre>