title: PHP cookie superglobal does not seem to be set
body: <p>I am currently developing a PHP website. I am trying to set a cookie which will store a user id. This is for a logging in system and I need the user id to be able to add it into different tables in a MySQL database. </p>
  
  <p>When the user successfully logs in it creates a PHP session and a cookie and then uses a meta tag refresh to direct to the index page. </p>
  
  <pre><code>if ($row = mysql_fetch_array($result))
  {
      setcookie('id', $row['use_id']);
      $_SESSION['user'] = $username;
      setcookie('userID', $row['use_id']);
      echo '&lt;meta http-equiv="refresh" content="0;url=../index.php"&gt;';
  }
  </code></pre>
  
  <p>If I remove the meta refresh and just echo the cookie using <code>$_COOKIE['userID']</code> it works fine but when I try and use <code>$_COOKIE['userID']</code> on the index.php page after it has done the meta refresh it isn't displaying anything.</p>