diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 8f0a99709..bf1c56b72 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -67,9 +67,9 @@ export function getDeviceIdValue(){ return cookieValuesSplit[1]; } - const cookieValueMatch = cookieValue.match("(?<=did=).*?(?=&)"); + const cookieValueMatch = cookieValue.match("^did=[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}"); if(cookieValueMatch){ - return cookieValueMatch[0]; + return cookieValueMatch[0].split('=')[1]; } return '';