new module:UWA/Utils/Cookie()
Index
Members
-
<static> defaults
-
Cookie.defaults An object representing default options to be used when setting and expiring cookie values.
Available Options
Options Description Default pathA string value of the path of the cookie "/" domainA string value of the domain of the cookie undefined expiresA number (of seconds), a date parsable string, undefined or a Date object of when the cookie will expire. secureA boolean value of whether or not the cookie false should only be available over SSL Example
Cookie.defaults = { path: '/', secure: true };
Methods
-
<static> get(key) → {String}
-
Returns the value of the most locally scoped cookie with the specified key.
Parameters
Name Type Description keyString cookie key
Returns
value - cookie value
- Type
- String
-
<static> getAll() → {Object}
-
Returns all cookies.
Returns
result
- Type
- Object
-
<static> set(key, value, options) → {Object}
-
Sets a cookie in the document. If the cookie does not already exist, it will be created.
Parameters
Name Type Description keyString cookie key
valueString cookie value
optionsObject cookie options
Returns
Cookie
- Type
- Object
-
<static> expire(key, options) → {Object}
-
Expires a cookie, removing it from the document
Parameters
Name Type Description keyString cookie key
optionsObject cookie options
Returns
- Cookie
- Type
- Object