Boxever.setCookie(cookieName, cookieValue[, expiresIn])
The setCookie() function creates a cookie in the browser.
Parameters
| Parameter | Type | Description | Note |
|---|---|---|---|
cookieName | string or number | The name of the cookie. | N/A |
cookieValue | string | The value of the cookie. | N/A |
[expiresIn]optional | integer | The number of days before the cookie expires. If you do not specify this value, the cookie becomes a session cookie. | For example, set the value to 1 for the cookie to expire in 1 day. |
Return value
undefined
Example
Create a cookie in the browser that expires in 1 day:
If you have suggestions for improving this article, let us know!