forked from avoidwork/abaaso
-
Notifications
You must be signed in to change notification settings - Fork 0
cookie
avoidwork edited this page Apr 24, 2012
·
1 revision
Easy cookie manipulation
Example
$.cookie.set("hw", "Hello world!", "21d"); // Creates cookie 'hw', which expires in 21 days
Expires a cookie
@param {String} name Name of the cookie to expire
@return {String} Name of the expired cookie
Example
$.cookie.expire("hw");
Gets a cookie
@param {String} name Name of the cookie to get
@return {Mixed} Cookie or undefined
Example
var cValue = $.cookie.get("hw");
Gets the cookies for the domain
@return {Object} Collection of cookies
Example
var cookies = $.cookie.list();
Creates a cookie
The offset specifies a positive or negative span of time as day, hour, minute or second
@param {String} name Name of the cookie to create
@param {String} value Value to set
@param {String} offset A positive or negative integer followed by "d", "h", "m" or "s"
@return {Object} The new cookie
Example
var objAsArray = $.array.cast(obj);