title: Can't set PHP cookie on the same page
body: <p>I'm having trouble setting cookies on the same page. I used cookies on my site and it works fine, I tend to set make the php in separate file. Now, I'm setting a cookie on the same page but it doesn't seem to work.</p>
  
  <pre><code>$expire = time()+5;
  setcookie("rb_vote", 1, $expire);
  </code></pre>
  
  <p>then check if it is set</p>
  
  <pre><code>if(isset($_COOKIE["rb_vote"]))  {
  echo "IS SET";}
  else {
  echo "IS NOT SET"; }
  </code></pre>
  
  <p>It always says is not set. I tried doing this in page load but still doesn't work.</p>