Q:

Timer for php page which activates button when timer ends

I want a countdown timer for php page which activates a disabled button in the same page when timer ends.
This timer should run even if the page is redirected to other pages. so whatever matters
when  the timer ends the button should get activated regardless of same page or another.
I tried with session but none works ! Any tested method to solve this ?

A:

You could try something like this.. and make sure that runs on every page load? Might need some tweaking to conform to your use case since you didn't supply much detail, but it might be a possible solution for you
//set a countdown
localStorage.pageCountdownTimer = parseInt(localStorage.pageCountdownTimer) || 20000;

// check every second if we passed the timer
var interval = setInterval(function() {
    localStorage.pageCountdownTimer -= 1000;

    if (localStorage.pageCountdownTimer <= 0) {

        // activate your button here

        localStorage.pageCountdownTimer = 0;
        clearInterval(interval);
    }
}, 1000);

