Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit 7456696

Browse files
author
Joel Worrall
committed
feat: handle domains
1 parent 42b0130 commit 7456696

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/CookieApprovalDialog.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ class CookieApprovalDialog extends React.Component {
1414
}
1515

1616
writeCookies(answer) {
17-
Cookies.set('newrelic-gdpr-consent', !!answer, {
18-
expires: 365
19-
});
17+
const currentEnvironment = process.env.ENV || process.env.NODE_ENV || "development";
18+
const options = { expires: 365 };
19+
if (currentEnvironment !== 'development') {
20+
options.domain = 'newrelic.com';
21+
}
22+
Cookies.set('newrelic-gdpr-consent', !!answer, options);
2023
// console.debug(Cookies.get('newrelic-gdpr-consent'));
2124
this.setState({ cookieSet: true });
2225
}

0 commit comments

Comments
 (0)