From 82c171dd70dd69aed50d0450913c89b22c0d2a7d Mon Sep 17 00:00:00 2001 From: Niall Date: Thu, 19 Sep 2024 16:33:58 +0100 Subject: [PATCH 1/3] add package implementation --- .../website/javascript/cookie-validity-update.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md b/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md index 39ab1647f2..8550e9efc8 100644 --- a/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md +++ b/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md @@ -43,6 +43,21 @@ analytics.load('writeKey', { } }) ``` + +To set these values via the [NPM package](https://github.com/segmentio/analytics-next/tree/master/packages/browser), you can set these cookie values like so: +```js + analytics = AnalyticsBrowser.load({ + writeKey: 'writeKey' + }, { + cookie: { + domain: 'sub.site.example', + maxage: 7, // 7 days + path: '/', + sameSite: 'Lax', + secure: true + } + }) +``` > info "" > Chrome has a maximum limit of 400 days for cookies. If a value is set beyond that, then Chrome sets the upper limit to 400 days instead of rejecting it. Visit Chrome's [docs](https://developer.chrome.com/blog/cookie-max-age-expires/){:target="blank"} to learn more. From 8d7ba9f0528380c4a3a9eaae6776d62e646300fb Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Wed, 25 Sep 2024 11:08:12 +0100 Subject: [PATCH 2/3] Update src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md Co-authored-by: stayseesong <83784848+stayseesong@users.noreply.github.com> --- .../libraries/website/javascript/cookie-validity-update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md b/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md index 8550e9efc8..9a6e0137f5 100644 --- a/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md +++ b/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md @@ -44,7 +44,7 @@ analytics.load('writeKey', { }) ``` -To set these values via the [NPM package](https://github.com/segmentio/analytics-next/tree/master/packages/browser), you can set these cookie values like so: +To set the values using the [NPM package](https://github.com/segmentio/analytics-next/tree/master/packages/browser){:target="_blank"}, set the cookie values like to: ```js analytics = AnalyticsBrowser.load({ writeKey: 'writeKey' From 83d1cc6d131002fa2765871f97e80df2ff715eb0 Mon Sep 17 00:00:00 2001 From: forstisabella <92472883+forstisabella@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:53:38 -0500 Subject: [PATCH 3/3] Update src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md --- .../libraries/website/javascript/cookie-validity-update.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md b/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md index 9a6e0137f5..4a647e6eda 100644 --- a/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md +++ b/src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md @@ -44,7 +44,8 @@ analytics.load('writeKey', { }) ``` -To set the values using the [NPM package](https://github.com/segmentio/analytics-next/tree/master/packages/browser){:target="_blank"}, set the cookie values like to: +To set cookie values using the [NPM package](https://github.com/segmentio/analytics-next/tree/master/packages/browser){:target="_blank"}, use the following code snippet: + ```js analytics = AnalyticsBrowser.load({ writeKey: 'writeKey'