Skip to content

Commit

Permalink
πŸ› Fix Cookies are not authorized random issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickadam committed Dec 6, 2022
1 parent 0fe202a commit 22e641c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/browser/cookie.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { display } from '../tools/display'
import { findCommaSeparatedValue, generateUUID, ONE_SECOND } from '../tools/utils'
import { findCommaSeparatedValue, generateUUID, ONE_MINUTE, ONE_SECOND } from '../tools/utils'

export const COOKIE_ACCESS_DELAY = ONE_SECOND

Expand Down Expand Up @@ -36,7 +36,7 @@ export function areCookiesAuthorized(options: CookieOptions): boolean {
// the test cookie lifetime
const testCookieName = `dd_cookie_test_${generateUUID()}`
const testCookieValue = 'test'
setCookie(testCookieName, testCookieValue, ONE_SECOND, options)
setCookie(testCookieName, testCookieValue, ONE_MINUTE, options)
const isCookieCorrectlySet = getCookie(testCookieName) === testCookieValue
deleteCookie(testCookieName, options)
return isCookieCorrectlySet
Expand Down

0 comments on commit 22e641c

Please sign in to comment.