title: need the right way to setcookie in wordpress
body: <p>i've been looking the whole day how to setcookies in wordpress. in my way i found out (using the developer toolbar) that the cookie is set but still not working.
  i have 2 files the first contains the login form redirecting to another page to set the cookie and return to another page to check if it's working. domain which is tested on is like this : blog.mydomain.com. here's the setcookie file :</p>
  
  <pre><code>&lt;?php
  setcookie("user_name","test",time()+3600);
  ?&gt;
  </code></pre>
  
  <p>and chcking the cookie like this :</p>
  
  <pre><code>if(isset($_COOKIE["user_name"])){
  echo "cookie exists";
  }
  else{
  echo "cookie doesn't exist";
  }
  </code></pre>
  
  <p>i've read many topics about this issue but there was no clear answer.
  Thanks in advance</p>