How to set a countdown timer to a cookie expire date?
<p>What would be a good way to do a count down timer of a cookie expire date ?
I'm working on an static html page, and I'm having problem to find how to actually do that, something like this (<a href="http://jsfiddle.net/PKWXw/110/" rel="nofollow">jsfiddle</a>) should be fine for what i need, the problem comes on setting the seconds left after the cookie is setted, no idea on how to do that. Take note, the timer and "set the cookie" will be in different pages. Hope you can give me some tips or ideas.</p>

<p>JS fiddle code:</p>

<pre><code>&lt;script&gt;
    //count down function

var seconds_left = 10;
var interval = setInterval(function() {
    document.getElementById('timer_div').innerHTML = --seconds_left;

    if (seconds_left &lt;= 0)
    {
       document.getElementById('timer_div').innerHTML = "You are Ready!";
       clearInterval(interval);
    }
}, 1000);

//set the cookie funcion

    function music_player(){
    days=1; // number of days to keep the cookie
    myDate = new Date();
    myDate.setTime(myDate.getTime()+(days*24*60*60*1000));
    document.cookie = 'music_player=play; expires=' + myDate.toGMTString();
    }
&lt;/script&gt;

&lt;a href="#" class="yes_alive" onclick="music_player()"&gt;Set the cookie&lt;/a&gt;
&lt;div id="timer_div"&gt;&lt;/div&gt;
</code></pre>