Rate this page:

Cookie

Enables apps to store, retrieve, and delete cookies. These cookies cannot be seen by other apps.

Methods

saveLocalStorage (addonKey, name, value, expireDays)

Parameters

NameTypeDescription
addonKey

string

name

string

value

string

expireDays

number


readLocalStorage (addonKey, name)

Parameters

NameTypeDescription
addonKey

string

name

string

Returns

[undefined, string]


save (name, value, expires)

Save a cookie.

Parameters

NameTypeDescription
name

String

The name of the cookie.

value

String

The value of the cookie.

expires

Number

The number of days before the cookie expires.

Example

1
AP.cookie.save('my_cookie', 'my value', 1);

read (name, callback)

Get the value of a cookie.

Parameters

NameTypeDescription
name

String

The name of the cookie.

callback

function

The callback to pass the cookie data to.

Example

1
2
AP.cookie.save('my_cookie', 'my value', 1);
AP.cookie.read('my_cookie', function(value) { alert(value); });

erase (name)

Deletes a cookie.

Parameters

NameTypeDescription
name

String

The name of the cookie.

Example

1
2
3
AP.cookie.save('my_cookie', 'my value', 1);
AP.cookie.read('my_cookie', function(value) { alert(value); });
AP.cookie.erase('my_cookie');

Rate this page: