More specific, such as this?
Instead of storing a countdown value, it can be better to store the time/date when the countdown period will be reached.
That way, when loading the page, you can attempt to read that countdown time/date.
If no prior countdown time exists, set it to what it should be, and save it out to a cookie.
Then you can calculate the current countdown value by taking the difference between that time/date value, and the time/date of what it is right now.