Documentation

cookie

Allows add-ons to store, retrieve and erased cookies against the host JIRA / Confluence. These cannot be seen by other add-ons.

Methods

erase(name)

Remove the given cookie.

Parameters:
Name Type Description
name String

the name of the cookie to remove

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

read(name, callback)

Get the value of a cookie.

Parameters:
Name Type Description
name String

name of cookie to read

callback function

callback to pass cookie data

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

save(name, value, expires)

Save a cookie.

Parameters:
Name Type Description
name String

name of cookie

value String

value of cookie

expires Number

number of days before cookie expires

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