[ADF-2463] Moved core components to subfolder (#3062)

This commit is contained in:
Andy Stark
2018-03-12 16:24:40 +00:00
committed by Eugenio Romano
parent f3459e1221
commit 333e8ee89c
35 changed files with 69 additions and 68 deletions

View File

@@ -0,0 +1,38 @@
---
Added: v2.0.0
Status: 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 cookie
- `data` - Data value to set for the cookie
- `expiration` - Expiration date of the data
- `path` - "Pathname" to store the cookie
## Details
This service uses browser [cookies](https://en.wikipedia.org/wiki/HTTP_cookie)
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](storage.service.md) if you need to store data
beyond this size.
## See also
- [Content service](content.service.md)
- [Storage service](storage.service.md)