From 96bdfe4dd8e85f0938319125b8befdc85ffdc013 Mon Sep 17 00:00:00 2001 From: Jeremy Zimmerman Date: Tue, 8 Nov 2022 11:30:50 -0500 Subject: [PATCH] Renamed session variable. --- src/constants/cookie-names.js | 2 +- src/helpers/heritage-integration/cookie-helper.js | 6 +++--- src/helpers/unit-test-helper.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/constants/cookie-names.js b/src/constants/cookie-names.js index 5fab5289..2a405d75 100644 --- a/src/constants/cookie-names.js +++ b/src/constants/cookie-names.js @@ -1,7 +1,7 @@ import { applicationConfig } from "@/constants/application-config.js"; const cookieNames = { - FUNNEL_SESSION_INFO: `FunnelSessionInfo-${applicationConfig.CURRENT_ENVIRONMENT}`, + ISS_SESSION_INFO: `ISSSessionInfo-${applicationConfig.CURRENT_ENVIRONMENT}`, // Existing Safelite.com cookies DXDEV: "dxdev", diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 0de1e12f..619d613c 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -32,7 +32,7 @@ export function updateOrCreateFunnelCookie() { export function getFunnelCookie() { const cookieJson = document.cookie ?.split("; ") - ?.find((row) => row.startsWith(`${cookieNames.FUNNEL_SESSION_INFO}=`)) + ?.find((row) => row.startsWith(`${cookieNames.ISS_SESSION_INFO}=`)) ?.split("=")[1]; try { @@ -46,7 +46,7 @@ export function getFunnelCookie() { Removes cookie from browser. */ export function deleteFunnelCookie() { - createOrUpdateCookie(cookieNames.FUNNEL_SESSION_INFO, undefined, { maxAge: 0 }); + createOrUpdateCookie(cookieNames.ISS_SESSION_INFO, undefined, { maxAge: 0 }); } /* @@ -147,7 +147,7 @@ function setFunnelCookieProperties(properties) { } const cookieValueJson = JSON.stringify(cookie ?? {}); - createOrUpdateCookie(cookieNames.FUNNEL_SESSION_INFO, cookieValueJson, {}); + createOrUpdateCookie(cookieNames.ISS_SESSION_INFO, cookieValueJson, {}); } } diff --git a/src/helpers/unit-test-helper.js b/src/helpers/unit-test-helper.js index 0f275dd0..ed53fb51 100644 --- a/src/helpers/unit-test-helper.js +++ b/src/helpers/unit-test-helper.js @@ -62,7 +62,7 @@ export function getMountOptions(mockData) { // Heritage integration common methods export const cookies = { - [cookieNames.FUNNEL_SESSION_INFO]: `{"ReferralNumber":"1566818","ReferralDate":"2022-03-15T10:56:24.597","ReferralCorrelationId":"404d2b04-f86e-45c3-b373-127b6217b060","ShouldResetState":false,"DidHeritageFunnelUpdateLast":true}`, + [cookieNames.ISS_SESSION_INFO]: `{"ReferralNumber":"1566818","ReferralDate":"2022-03-15T10:56:24.597","ReferralCorrelationId":"404d2b04-f86e-45c3-b373-127b6217b060","ShouldResetState":false,"DidHeritageFunnelUpdateLast":true}`, UNIQUE_SESSION_ID: "33756020-b58e-4ec7-b8b8-3f1576719c40", anotherCookie: "{}", someOtherCookie: "{}", @@ -74,8 +74,8 @@ export const cookies = { export function setupCookies({ funnelCookieValue = "", includeHeritageCookie = true }) { Object.keys(cookies).forEach((key) => { const cookieValue = - key == cookieNames.FUNNEL_SESSION_INFO ? funnelCookieValue : cookies[key]; - if (includeHeritageCookie || key != cookieNames.FUNNEL_SESSION_INFO) + key == cookieNames.ISS_SESSION_INFO ? funnelCookieValue : cookies[key]; + if (includeHeritageCookie || key != cookieNames.ISS_SESSION_INFO) setCookieProperties({ [key]: cookieValue }, { isSecure: false }); }); }