title: how can i define a cookie global?
body: <p>i defined a cookie in a page like check.php and set it.</p>
  
  <pre><code>setcookie("u","blue",time() + 3600);
  </code></pre>
  
  <p>now i want to check that if it is set or no in another page like index.php.</p>
  
  <p>i sure that cookie is set in check.php but when i check that in index.php with this code:</p>
  
  <pre><code>if( isset($_COOKIE["u"] ) )
    {
          echo "correct";
    } 
  </code></pre>
  
  <p>it doesn't worked!!and if doesn't run?
  what is problem?if cookies worked only in that page that it defined?</p>
  
  <p>Edit:</p>
  
  <p>i change it to <code>setcookie("u","blue",time() + 3600,'/', 'www.example.vcn.ir');</code>
  but has same problem.</p>