diff --git a/packages/nuxt/src/app/composables/cookie.ts b/packages/nuxt/src/app/composables/cookie.ts index 7f5b6cd267..bdc9d93782 100644 --- a/packages/nuxt/src/app/composables/cookie.ts +++ b/packages/nuxt/src/app/composables/cookie.ts @@ -198,6 +198,7 @@ function cookieRef (value: T | undefined, delay: number, shouldWatch: boolean if (shouldWatch) { unsubscribe = watch(internalRef, trigger) } function createExpirationTimeout () { + elapsed = 0 clearTimeout(timeout) const timeRemaining = delay - elapsed const timeoutLength = timeRemaining < MAX_TIMEOUT_DELAY ? timeRemaining : MAX_TIMEOUT_DELAY