Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Countdown timer javascript with cookies

Featured Replies

Hi there,

 

I have a js countdown timer which counts down from 60 seconds to zero and when it hits zero it redirects the page.

 

Only problem is that when the user refreshes the page the timer obviously reverts to 60 seconds.

 

Does anyone have any code which would turn this into a cookie so that the location of the timer is stored each time the page is refreshed and then the timer continues from where it left off?

 

My timer is using setTimeout.

 

I've seen a couple of examples of this on various forums but none actually seem to work - my cookies are switched on.

 

Also, I cannot use form, input or anything else like this due to the third party software we're using (long story!).

 

Any help would be lovely.

 

Thanks!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.