Rate this page:
Enables apps to store, retrieve, and delete cookies. These cookies cannot be seen by other apps.
Save a cookie.
Name | Type | Description |
---|---|---|
name | String | The name of the cookie. |
value | String | The value of the cookie. |
expires | Number | The number of days before the cookie expires. |
1
AP.cookie.save('my_cookie', 'my value', 1);
Get the value of a cookie.
Name | Type | Description |
---|---|---|
name | String | The name of the cookie. |
callback | function | The callback to pass the cookie data to. |
1 2
AP.cookie.save('my_cookie', 'my value', 1);
AP.cookie.read('my_cookie', function(value) { alert(value); });
Deletes a cookie.
Name | Type | Description |
---|---|---|
name | String | The name of the cookie. |
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: