title: Accessing $_COOKIE immediately after setcookie()
body: <p>I'm trying to access a cookie's value (using <code>$_COOKIE</code>) immediately after calling the <code>setcookie()</code> function in PHP.  When I do so, <code>$_COOKIE['uname']</code> isn't set.  Why? </p>
  
  <p>Note, however, that <code>$_COOKIE['uname']</code> is set as expected upon the next execution of the script, such as after a page refresh.</p>
  
  <pre><code>setcookie('uname', $uname, time() + 60 * 30);
  echo "Cookie value: " . $_COOKIE['uname'];
  </code></pre>