Created
July 21, 2010 20:57
-
-
Save meeech/485122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myCookie; | |
myCookie = function(config) { | |
myCookie.superclass.constructor.apply(this,arguments); | |
}; | |
Y.extend(myCookie, Y.Cookie, { | |
_createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ { | |
options = options || {}; | |
console.log(name); | |
var text /*:String*/ = (encodeValue ? encode(name) : name) + "=" + (encodeValue ? encode(value) : value), | |
expires = options.expires, | |
path = options.path, | |
domain = options.domain; | |
if (isObject(options)){ | |
//expiration date | |
if (expires instanceof Date){ | |
text += "; expires=" + expires.toUTCString(); | |
} | |
//path | |
if (isString(path) && path !== ""){ | |
text += "; path=" + path; | |
} | |
//domain | |
if (isString(domain) && domain !== ""){ | |
text += "; domain=" + domain; | |
} | |
//secure | |
if (options.secure === true){ | |
text += "; secure"; | |
} | |
} | |
return text; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment