Skip to content

Commit 82c171d

Browse files
committed
add package implementation
1 parent 90ecca8 commit 82c171d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ analytics.load('writeKey', {
4343
}
4444
})
4545
```
46+
47+
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:
48+
```js
49+
analytics = AnalyticsBrowser.load({
50+
writeKey: 'writeKey'
51+
}, {
52+
cookie: {
53+
domain: 'sub.site.example',
54+
maxage: 7, // 7 days
55+
path: '/',
56+
sameSite: 'Lax',
57+
secure: true
58+
}
59+
})
60+
```
4661
> info ""
4762
> 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.
4863

0 commit comments

Comments
 (0)