title: setcookie() always returns true, even when browser cookies are disabled
body: <p>why is this if statement always true? Even if i disable cookies in browser, it tells me "Cookie was set." print_r prints empty array, but it should say "No Cookie could be set, please allow cookies."</p>
  
  <p>What's wrong with my code?</p>
  
  <pre><code>if (setcookie("Testcookie", "values of cookie", time()+3600*24))   // 1h*24 = 24hours
     {
          echo ("Cookie was set. ");
          print_r ($_COOKIE);
  } else {
          echo("No Cookie could be set, please allow cookies.");
  }
  </code></pre>
  
  <p>UPDATE: i tried this:</p>
  
  <pre><code>setcookie("Testcookie", "values of cookie", time()+3600*24);    // 1h*24 = 24hours
  
  if ((isset($_COOKIE)) &amp;&amp; (!empty($_COOKIE))) { print_r($_COOKIE);} else {echo("No Cookie found.");}
  </code></pre>
  
  <p>This sets Cookie correctly, but it says "No Cookie found". After one reload it finds Cookie and print_r it. Why does it take one reload? I didn't send anything prior setcookie() call. Cookie IS set, but on first reload after deleting/enabling cookies it is not shown.</p>