Attach Javascript variable to cookie
<p>I've been strugling, maybe someone can help me please?  I've got a javascript counter on my page, trying to attach it to a cookie (<a href="http://stackoverflow.com/questions/7764051/javascript-counter-on-php-page">My first quetion about this</a>) so that if the user refreshes the page the counter does not start from 0 again:</p>

<p><strong>page 1:</strong>  </p>

<pre><code>&lt;head&gt;
&lt;script type="text/javascript"&gt;
var pageVisisted = new Date(); 
setInterval(function() {
    var timeOnSite = new Date() - pageVisisted;
    var secondsTotal = timeOnSite / 1000;
    var hours = Math.floor(secondsTotal / 3600);
    var minutes = Math.floor(secondsTotal / 60) % 3600;
    var seconds = Math.floor(secondsTotal)  % 60;
    document.getElementById('counter').innerHTML = hours + ":" + minutes + ":" + seconds;
}, 1000);
&lt;/script&gt;
&lt;?php
setcookie(AboutVisit, pageVisisted);
session_start();
?&gt;
&lt;/head&gt;
</code></pre>

<p><strong>Page2:</strong></p>

<pre><code>$cookid = $_COOKIE['AboutVisit'];
echo $cookid;
</code></pre>

<p><strong>But then I get the display:  pageVisisted</strong></p>
