Methods
# static getCookie(cookie_name)
Get a cookie with a given name
Parameters:
| Name | Type | Description |
|---|---|---|
cookie_name |
string
|
name of the cookie |
Example
import { getCookie } from "nan-design-system/utils";
const cookie = getCookie("my_cookie");
# static removeCookie(cookie_name, domain)
Remove cookie with a given name
Parameters:
| Name | Type | Description |
|---|---|---|
cookie_name |
string
|
name of the cookie |
domain |
string
|
domain of the cookie |
Example
import { removeCookie } from "nan-design-system/utils";
const cookie = removeCookie("my_cookie");
# static setCookie(cookie_name, cookie_value, exdays, domain)
Set a cookie
Parameters:
| Name | Type | Description |
|---|---|---|
cookie_name |
string
|
name of the cookie |
cookie_value |
string
|
value of the cookie |
exdays |
float
|
days until expiration |
domain |
string
|
domain of the cookie |
Example
import { setCookie } from "nan-design-system/utils";
const cookie = setCookie("my_cookie", "my_cookie_value", 7);