Javascript counter on php page
<p>I've got a java script counter on my php page.  (I should probably add that I don't know java script).  It display's the time the user is active on the page.  My problem is if the user presses F5 or refreshes the page the counter starts from 0 again.  How do I change this so that it remembers the time?  Help will be greatly appreciated.</p>

<p><strong>Javascript:</strong></p>

<pre><code>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);
</code></pre>

<p><strong>The php page</strong></p>

<pre><code>&lt;head&gt;
&lt;?php
session_start();
?&gt;
&lt;script type="text/javascript" src="counter.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
echo "&lt;span id='counter'&gt;&lt;/span&gt;";
?&gt;
&lt;/body&gt;
</code></pre>
