Set and Retrieve cookie trouble in PHP
<p>I have a three pieces of code that are giving me trouble.</p>

<p>This one sets the cookie</p>

<pre><code>setcookie("verify", "$value", time()+3600);  
</code></pre>

<p>This one is on a different page, it makes sure the cookie has the correct value</p>

<pre><code>if ( $_COOKIE["verify"] != file("name.txt")) { 
header("location: notset.html");
} else { die;  }
</code></pre>

<p>And this one deletes the cookie</p>

<pre><code>setcookie("verify", "", time()-3600);
</code></pre>

<p>The code to write the cookie doesn't actually write the cookie. And the variable is set, but no matter what the cookie will not set. So when I manually input the value by writing "test" and write test to "name.txt" and go to the page with the IF statement, it will take me to notset.html. Any ideas on why this isn't working?</p>

<p>Oh and the delete cookie code works when I enter the test into both the cookie and name.txt. So the delete code works, but the first two do not.</p>
