Class R.storage.CookieStorage
Extends
R.storage.AbstractStorage.
R.storage.CookieStorage is used to maintain data in a
cookie using a JSON object. If cookies are not supported, the methods
will have no effect.
Defined in: cookiestorage.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.storage.CookieStorage(name, options)
This class of storage is used to persist data in a cookie.
|
Method Attributes | Method Name and Description |
---|---|
clear()
Clear all of the data stored in the cookie.
|
|
dispose()
Dispose of the cookie (remove it from the user's browser).
|
|
Get the class name of this object
|
|
Initialize the storage object to the document.cookie object
|
|
load(key)
Get the value associated with the key from cookie storage.
|
|
release()
Release the object back into the object pool.
|
|
save(key, value)
Save a value to cookie storage.
|
- Methods borrowed from class R.storage.AbstractStorage:
- destroy, flush, getStorageObject, loadData, saveData, setStorageObject
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.storage.CookieStorage(name, options)
This class of storage is used to persist data in a cookie.
- Parameters:
- name
- {String} The name of the cookie
- options
- {Object} An object which contains any of the following: path, domain, secure (boolean), and expires (number). Any of the values can be left off, in which case defaults will be used.
Method Detail
clear()
Clear all of the data stored in the cookie.
dispose()
Dispose of the cookie (remove it from the user's browser).
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} "R.storage.CookieStorage"
{Object}
initStorageObject()
Initialize the storage object to the document.cookie object
- Returns:
- {Object} The localStorage object
{Object}
load(key)
Get the value associated with the key from cookie storage.
- Parameters:
- key
- {String} The key to retrieve data for
- Returns:
- {Object} The value that was stored with the key, or null
release()
Release the object back into the object pool.
save(key, value)
Save a value to cookie storage.
- Parameters:
- key
- {String} The key to store the data with
- value
- {Object} The value to store with the key