mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4152] Updated folder structure of core docs (#4415)
* [ADF-4152] Moved core library docs into subfolders * [ADF-4152] Moved core library docs into subfolders * [ADF-4152] Manual fixes to core doc file links * [ADF-4152] Further automatic + manual link tidying
This commit is contained in:
committed by
Eugenio Romano
parent
285e56e9fb
commit
5fc05da7aa
46
docs/core/services/cookie.service.md
Normal file
46
docs/core/services/cookie.service.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
Title: Cookie service
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-11-13
|
||||
---
|
||||
|
||||
# [Cookie service](../../../lib/core/services/cookie.service.ts "Defined in cookie.service.ts")
|
||||
|
||||
Stores key-value data items as browser cookies.
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
|
||||
- **clear**()<br/>
|
||||
Placeholder for testing purposes - do not use.
|
||||
- **getItem**(key: `string`): `string|null`<br/>
|
||||
Retrieves a cookie by its key.
|
||||
- _key:_ `string` - Key to identify the cookie
|
||||
- **Returns** `string|null` - The cookie data or null if it is not found
|
||||
- **isEnabled**(): `boolean`<br/>
|
||||
Checks if cookies are enabled.
|
||||
- **Returns** `boolean` - True if enabled, false otherwise
|
||||
- **setItem**(key: `string`, data: `string`, expiration: `Date|null`, path: `string|null`)<br/>
|
||||
Sets a cookie.
|
||||
- _key:_ `string` - Key to identify the cookie
|
||||
- _data:_ `string` - Data value to set for the cookie
|
||||
- _expiration:_ `Date|null` - Expiration date of the data
|
||||
- _path:_ `string|null` - "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)
|
Reference in New Issue
Block a user