You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,14 +19,14 @@ If a user returns to your site after the cookie expires, Analytics.js looks for
18
19
Analytics.js sets some default properties when creating cookies for user or group identities. You can override the default cookie properties in code when loading Analytics.js by passing in a `cookie` object to the load method.
19
20
20
21
> info ""
21
-
> Analytics.js doesn't set third-party cookies and only sets first-party cookies.
22
+
> Analytics.js doesn't set third-party cookies and only sets first-party cookies.
22
23
23
24
Here is the full list of available parameters with their default values:
24
25
25
26
| Parameter | Description | Default value |
26
27
| --- | --- | --- |
27
28
|`domain`| The domain to set the cookie to. This must match the domain of the JavaScript origin. If an Analytics.js cookie already exists at the top-level domain, Segment carries the same cookie value to any subdomains, despite `domain` configuration. | Top-level domain |
28
-
|`maxage`| The maximum amount of time in seconds before the cookie expires. Browsers may clear cookies before this elapses. | 1 year |
29
+
|`maxage`| The maximum amount of time in days before the cookie expires. Browsers may clear cookies before this elapses. | 1 year |
29
30
|`path`| The path the cookie is valid for. |`"/"`|
30
31
|`sameSite`| This prevents the browser from sending the cookie along with cross-site requests. |`Lax`|
31
32
|`secure`| This determines whether cookies can only be transmitted over secure protocols such as https. |`false`|
@@ -35,13 +36,15 @@ Example:
35
36
analytics.load('writeKey', {
36
37
cookie: {
37
38
domain:'sub.site.example',
38
-
maxage:604800, // 7 days in seconds
39
+
maxage:7, // 7 days
39
40
path:'/',
40
41
sameSite:'Lax',
41
42
secure:true
42
43
}
43
44
})
44
45
```
46
+
> info ""
47
+
> 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.
0 commit comments