getCookie

Retrieve a cookie visible to the current page. You can query a specific cookie by providing the cookie name or retrieve all.

Usage

1
client.getCookie([name]).then(callback);

Parameters

Param Type Details
name
optional
String name of requested cookie

Example

getCookie.js
1
2
3
4
5
6
7
8
client
.setCookie({name: 'test', value: '123'})
.getCookie('test').then(function(cookie) {
console.log(cookie); // outputs: { name: 'test', value: '123' }
})
.getCookie().then(function(cookies) {
console.log(cookies); // outputs: [{ name: 'test', value: '123' }]
});

Uses