You could try creating a cookie and update it every 10 or 30 seconds. Then when the page loads, check to see if the cookie is less than 3 minutes and start from that value. When the timer reaches zero - delete the cookie.