Namespace: Cookies:getCookie

Cookies:getCookie

Source:

Methods

getCookie(nameopt) → {String|Object|null}

Retrieves a decoded cookie value by name. Automatically decodes the value (assumes, that, if encoded, url/percent encoding has been used).

Parameters:
Name Type Attributes Description
name String | Array.<String> <optional>

the name of the cookie (or several names), if empty, all available cookies are returned

Source:
See:
Returns:
decoded value of the cookie, null, if no such cookie available or a dictionary of found cookies if all or a list are being returned (if a list is requested and non are found, an empty object is returned)
Type
String | Object | null
Example
getCookie('foobar')
=> 'value'
getCookie(['foobar', 'boofar'])
=> {foobar : 'value', boofar : 'value'}
getCookie()
=> all available cookies