mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
1.1 KiB
1.1 KiB
Added, Status
Added | Status |
---|---|
v2.0.0 | Active |
Cookie service
Stores key-value data items as browser cookies.
Methods
-
isEnabled(): boolean
Checks if cookies are enabled. -
getItem(key: string): string
Retrieves a cookie by its key.key
- Key to identify the cookie
-
setItem(key: string, data: string, expiration: Date | null, path: string | null)
Set a cookie.key
- Key to identify the cookiedata
- Data value to set for the cookieexpiration
- Expiration date of the datapath
- "Pathname" to store the cookie
Details
This service uses browser cookies
to store data in the form of key-value pairs. An optional expiration
date can be
supplied for the cookie and a path
can be used to reduce the chances of name
clashes with cookies from other sources.
Cookies have a storage size limit that varies between browsers but is often around 4KB. Consider using web storage if you need to store data beyond this size.