For keeping track of time in your browser, consider using localStorage instead of cookies. Look up the MDN for a thorough specification, or simply type "localStorage" in your browser's JavaScript console to explore its methods. With just one getter and one setter, localStorage is a simple and direct way to store and display countdown timers by calculating the end time as the stored time minus the current time.
Reserve the use of cookies for cases where users may be accessing your site with outdated browsers.
If you want to ensure absolute accuracy, consider making AJAX calls to initiate and monitor the timer, rather than relying solely on clientside solutions. This method adds an additional layer of security, as localStorage can be easily manipulated. It may require more effort, but the peace of mind is worth it.
For further insights and detailed information, feel free to explore additional resources.