From ff68691e26775bc77599c56a36a5468536e274c4 Mon Sep 17 00:00:00 2001 From: Sneh1999 Date: Thu, 14 Dec 2023 19:45:15 -0500 Subject: [PATCH] cleanup --- packages/cookie-manager/CHANGELOG.md | 6 +++++- packages/cookie-manager/README.md | 4 ++-- packages/cookie-manager/src/constants.ts | 8 -------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/cookie-manager/CHANGELOG.md b/packages/cookie-manager/CHANGELOG.md index b4d65f3..64de425 100644 --- a/packages/cookie-manager/CHANGELOG.md +++ b/packages/cookie-manager/CHANGELOG.md @@ -2,7 +2,11 @@ ## 1.1.0 (12/14/2023) -Support retention durations for Cookies in the config and category level +- Updated cookie config to include retention durations at both category and cookie levels. +- Introduced an optional boolean field `sessionCookie` in cookie config to accommodate session cookies. +- Implemented a setExpiryForCookie hook that adjusts the cookie's expiration in the following manner: + - If the sessionCookie parameter is enabled, the expiry is set to session + - If an expiry is specified at the cookie level, it takes precedence; otherwise, the expiry is derived from the category's expiration setting. ## 1.0.0 (12/7/2023) diff --git a/packages/cookie-manager/README.md b/packages/cookie-manager/README.md index 917b7e7..04db9eb 100644 --- a/packages/cookie-manager/README.md +++ b/packages/cookie-manager/README.md @@ -74,7 +74,7 @@ export default { { id: 'locale', type: TrackerType.COOKIE, - expiry: new Date('2024-09-29T00:00:00.000Z'), + expiry: 10, }, ], }, @@ -163,7 +163,7 @@ You need to specify the retention days for a category using the expiry key as fo { id: 'locale', type: TrackerType.COOKIE, - expiry: new Date('2024-09-29T00:00:00.000Z'), + expiry: 10, }, ], } diff --git a/packages/cookie-manager/src/constants.ts b/packages/cookie-manager/src/constants.ts index 90075d4..14f2c86 100644 --- a/packages/cookie-manager/src/constants.ts +++ b/packages/cookie-manager/src/constants.ts @@ -34,11 +34,3 @@ export const TRACKER_CATEGORIES: Array = [ TrackingCategory.PERFORMANCE, TrackingCategory.TARGETING, ]; - -export const CATEGORY_EXPIRATION_DAYS: Record = { - [TrackingCategory.NECESSARY]: 365, - [TrackingCategory.FUNCTIONAL]: 365, - [TrackingCategory.PERFORMANCE]: 365, - [TrackingCategory.TARGETING]: 365, - [TrackingCategory.DELETE_IF_SEEN]: 0, -};