Rate this page:

Cookie

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

Methods

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: