Canteen.SavedData Class
Utility class for saving data to JavaScript cookies
Methods
clear
(
static
-
name
Clear a cookie value by name
Parameters:
-
name
StringThe name of the cooie property
read
(
Mixed
static
-
name
Read the value of the cookie
Parameters:
-
name
StringThe name of the cookie
Returns:
Mixed:
The value or null if it doesn't exist
write
(
static
-
name
-
value
-
days
Create a cookie variable
Parameters:
-
name
StringThe name of the cookie to create
-
value
MixedThe value to save
-
days
IntThe number of days to keep - omit this to have the data cleared when the browser is closed
Properties
NEVER_EXPIRE
String
final
static
Use this value in place of 'days' to save data that expires when the Date object no longer functions (more than 270 thousand years from now)
Default: neverExpire