Test for cookies in PHP
<p>What is the best way to tell if someone has cookies enabled in their browser.  I tried:</p>

<pre><code>&lt;?php

        setcookie('cookies','yes',time()+7200);
    if (!isset($_COOKIE['cookies'])) {
        echo '&lt;div class="error" style="float:right;"&gt;You must enable cookies and Javascript to use this site.&lt;/div&gt;';
    } else {
        echo '';
    }


?&gt;
</code></pre>

<p>but sometimes it displays the alert even if cookies are enabled.  I only want an alert if cookies are NOT enabled.</p>
