You can no longer publish Connect apps on the Atlassian Marketplace. All new extensibility features will be delivered only on Forge.
Refer to this blog post for our timeline to end Connect support.
Have an existing Connect app? You can incrementally migrate it to Forge.
Enables apps to store, retrieve, and delete client side data. The data is stored in the Atlassian product's localStorage, not the app's localStorage. This data cannot be seen by other apps. This module is named "Cookie" as it originally used cookies to store data. It now uses localStorage, but the name has been kept for backwards compatibility.
Save a value to localStorage.
Name | Type | Description |
---|---|---|
name | String | The name to store the data against. |
value | String | The value to store. |
expires | Number | Optional, the number of days before expiry, defaults to 365. |
1 2AP.cookie.save('my_cookie', 'my value', 1);
Get a value from localStorage (falls back to cookie for legacy support).
Name | Type | Description |
---|---|---|
name | String | The name to store the data against. |
callback | function | The callback to pass the data to. |
1 2AP.cookie.save('my_cookie', 'my value', 1); AP.cookie.read('my_cookie', function(value) { alert(value); });
Deletes a value from localStorage.
Name | Type | Description |
---|---|---|
name | String | The name of the data to remove. |
1 2AP.cookie.save('my_cookie', 'my value', 1); AP.cookie.read('my_cookie', function(value) { alert(value); }); AP.cookie.erase('my_cookie');
Rate this page: