title: PHP isset for cookie not working
body: <p>I am facing some trouble with a conditional statement that uses cookies in PHP.</p>
  
  <p>I would like to change the state of an image based on whether a cookie is set or not. Here is my code (in file MAIN.PHP):</p>
  
  <pre><code>$cookie = "d_content_vote_".$databaseArray['id']; 
  if(!isset($_COOKIE[$cookie])) {
    // display image 1 if cookie is not set
  }
  else { 
    // display image 2 if cookie is set
  }
  </code></pre>
  
  <p>The cookie value (of the timestamp) is set in ../INCLUDES/RATING.PHP, and I make an ajax call to that file. In order to debug, I did a <code>print_r($_COOKIE)</code> in RATING.PHP which gave me this:</p>
  
  <pre><code>Array
  (
      [d_content_vote_1] =&gt; 1402726678
      [d_content_vote_4] =&gt; 1402727148
      [PHPSESSID] =&gt; effa8778efbe1b3dfb5bb301e359997d
  )
  </code></pre>
  
  <p>However, when I do a print_r($_COOKIE) in MAIN.PHP I do not get the d_content_vote_* cookies, only the session info.</p>
  
  <p>How do I transfer the cookie that is set in rating.php so that I can use it in main.php. I have never faced this problem before.</p>
  
  <p>[Additional info: I'm building the site on a MAMP server now]</p>