From 2ae25e6bd019e37fce64e76e93b5dcb1f43d2cec Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 6 Dec 2024 10:33:05 -0500 Subject: [PATCH 1/2] cookie date time fix The cookie is storing date time attributes in UTC causing an exception in heritage code when it hits the comma separating parts of the string. ie: SavedSessionTimeoutDate":"Mon, 20 Jan 2025 15:31:51 GMT" --- src/helpers/heritage-integration/cookie-helper.js | 2 +- src/helpers/heritage-integration/session-helper.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 0bd4ae563..4ff5c0c8e 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -13,7 +13,7 @@ export function updateOrCreateFunnelCookie() { // Set up cookie with all the props. setFunnelCookieProperties({ - LastTouched: new Date().toUTCString(), + LastTouched: new Date().toJSON(), SavedSessionTimeoutDate: store.getters.applicationUser.savedSessionTimeout, DidHeritageFunnelUpdateLast: false, ShouldResetState: false, diff --git a/src/helpers/heritage-integration/session-helper.js b/src/helpers/heritage-integration/session-helper.js index 291ebfaf8..d932969d1 100644 --- a/src/helpers/heritage-integration/session-helper.js +++ b/src/helpers/heritage-integration/session-helper.js @@ -43,5 +43,5 @@ Function to calculate the date for the saved session timeout. export function getDateForSavedSessionTimeout() { const currentDate = new Date(new Date().toUTCString()); currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS); - return currentDate.toUTCString(); + return currentDate.toJSON(); } From b02cbf5ceb73e1c789912ed9b5f2fb80b968b021 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 6 Dec 2024 10:54:09 -0500 Subject: [PATCH 2/2] test fix test fix --- src/helpers/heritage-integration/session-helper.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/session-helper.spec.js b/src/helpers/heritage-integration/session-helper.spec.js index fe3e308da..11440c544 100644 --- a/src/helpers/heritage-integration/session-helper.spec.js +++ b/src/helpers/heritage-integration/session-helper.spec.js @@ -81,7 +81,7 @@ describe("getDateForSavedSessionTimeout", () => { currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS); // Act - const result = getDateForSavedSessionTimeout(); + const result = new Date(getDateForSavedSessionTimeout()).toUTCString(); // Assert expect(result).toEqual(currentDate.toUTCString());