javascript unexpected token COOKIE
<p>so i have this problem, i'm using a index.inc.php file to set a cookie and this is a must.</p>

<p>The problem of setting a cookie with server-side language is that it will not take effect on the first load. The javascript is on the template file index.tpl (Using XTemplate), the COOKIE2 and COOKIE3 are values defined on the PHP, they are cookie values, but on the first load, always empty.</p>

<pre><code>var ligarei = getCookie('ligarei');
if(ligarei != "nao"){
    var cookie2 = {COOKIE2};
    var cookie3 = {COOKIE3};
    var timeout = cookie3 - cookie2;
    var timeout2 = 60 - timeout;

    $(document).ready(function() {
        if(timeout &gt; 60){
            popthat();
        }
        else if(timeout &lt; 60){
            setTimeout("popthat()", timeout2 * 1000);
        }

    });
}
</code></pre>

<p>The first getCookie function is ok, it doesn't matter if it's empty or null, but the problem is on the var cookie2 and cookie3, the result after compiled is:</p>

<pre><code>var cookie = ; 
</code></pre>

<p>And this is giving me a unexpected token error .</p>

<p>Any hints on how to solve this?</p>

<p>Thanks very much.</p>
