From a3d8f005a648d5081ed8dcb052fdf2c4bcbbed10 Mon Sep 17 00:00:00 2001 From: Leo Osa Date: Sat, 15 Jun 2024 14:24:15 +0300 Subject: [PATCH] fix(nuxt): reset cookie timeoutLength after expiration (#27632) --- packages/nuxt/src/app/composables/cookie.ts | 1 + 1 file changed, 1 insertion(+) 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