alfresco-ng2-components/docs/cookie.service.md
2017-11-09 13:20:56 +00:00

996 B

Cookie service

Stores key-value data items as browser cookies.

Methods

getItem(key: string): string | null
Gets an item identified by key.

setItem(key: string, data: string, expiration: Date | null, path: string | null): void
Stores an item under key.

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.

See also