Renamed session variable.
This commit is contained in:
parent
744c02c57b
commit
96bdfe4dd8
3 changed files with 7 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { applicationConfig } from "@/constants/application-config.js";
|
import { applicationConfig } from "@/constants/application-config.js";
|
||||||
|
|
||||||
const cookieNames = {
|
const cookieNames = {
|
||||||
FUNNEL_SESSION_INFO: `FunnelSessionInfo-${applicationConfig.CURRENT_ENVIRONMENT}`,
|
ISS_SESSION_INFO: `ISSSessionInfo-${applicationConfig.CURRENT_ENVIRONMENT}`,
|
||||||
|
|
||||||
// Existing Safelite.com cookies
|
// Existing Safelite.com cookies
|
||||||
DXDEV: "dxdev",
|
DXDEV: "dxdev",
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export function updateOrCreateFunnelCookie() {
|
||||||
export function getFunnelCookie() {
|
export function getFunnelCookie() {
|
||||||
const cookieJson = document.cookie
|
const cookieJson = document.cookie
|
||||||
?.split("; ")
|
?.split("; ")
|
||||||
?.find((row) => row.startsWith(`${cookieNames.FUNNEL_SESSION_INFO}=`))
|
?.find((row) => row.startsWith(`${cookieNames.ISS_SESSION_INFO}=`))
|
||||||
?.split("=")[1];
|
?.split("=")[1];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -46,7 +46,7 @@ export function getFunnelCookie() {
|
||||||
Removes cookie from browser.
|
Removes cookie from browser.
|
||||||
*/
|
*/
|
||||||
export function deleteFunnelCookie() {
|
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 ?? {});
|
const cookieValueJson = JSON.stringify(cookie ?? {});
|
||||||
createOrUpdateCookie(cookieNames.FUNNEL_SESSION_INFO, cookieValueJson, {});
|
createOrUpdateCookie(cookieNames.ISS_SESSION_INFO, cookieValueJson, {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ export function getMountOptions(mockData) {
|
||||||
|
|
||||||
// Heritage integration common methods
|
// Heritage integration common methods
|
||||||
export const cookies = {
|
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",
|
UNIQUE_SESSION_ID: "33756020-b58e-4ec7-b8b8-3f1576719c40",
|
||||||
anotherCookie: "{}",
|
anotherCookie: "{}",
|
||||||
someOtherCookie: "{}",
|
someOtherCookie: "{}",
|
||||||
|
|
@ -74,8 +74,8 @@ export const cookies = {
|
||||||
export function setupCookies({ funnelCookieValue = "", includeHeritageCookie = true }) {
|
export function setupCookies({ funnelCookieValue = "", includeHeritageCookie = true }) {
|
||||||
Object.keys(cookies).forEach((key) => {
|
Object.keys(cookies).forEach((key) => {
|
||||||
const cookieValue =
|
const cookieValue =
|
||||||
key == cookieNames.FUNNEL_SESSION_INFO ? funnelCookieValue : cookies[key];
|
key == cookieNames.ISS_SESSION_INFO ? funnelCookieValue : cookies[key];
|
||||||
if (includeHeritageCookie || key != cookieNames.FUNNEL_SESSION_INFO)
|
if (includeHeritageCookie || key != cookieNames.ISS_SESSION_INFO)
|
||||||
setCookieProperties({ [key]: cookieValue }, { isSecure: false });
|
setCookieProperties({ [key]: cookieValue }, { isSecure: false });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue