public/javascripts/yui/cookie/cookie.js
function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
        
        var lang = YAHOO.lang;
        
        options = options || {};
        
        if (!lang.isString(name)){
            throw new TypeError("Cookie.set(): Cookie name must be a string.");
        }
        
        if (lang.isUndefined(value)){
            throw new TypeError("Cookie.set(): Value cannot be undefined.");
        }
        
        var text /*:String*/ = this._createCookieString(name, value, !options.raw, options);
        document.cookie = text;
        return text;
    }
function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
        
        var lang = YAHOO.lang;
        
        options = options || {};
        
        if (!lang.isString(name)){
            throw new TypeError("Cookie.set(): Cookie name must be a string.");
        }
        
        if (lang.isUndefined(value)){
            throw new TypeError("Cookie.set(): Value cannot be undefined.");
        }
        
        var text /*:String*/ = this._createCookieString(name, value, !options.raw, options);
        document.cookie = text;
        return text;
    }
function ( name /*:String*/ , value /*:Variant*/ , options /*:Object*/ ) /*:String*/ { var lang = YAHOO . lang ; options = options || { } ; if ( ! lang . isString ( name ) ) { throw new TypeError ( "Cookie.set(): Cookie name must be a string." ) ; } if ( lang . isUndefined ( value ) ) { throw new TypeError ( "Cookie.set(): Value cannot be undefined." ) ; } var text /*:String*/ = this . _createCookieString ( name , value , ! options . raw , options ) ; document . cookie = text ; return text ; }
Sets a cookie with a given name and value.
@param {String} name The name of the cookie to set.
@param {Variant} value The value to set for the cookie.
@param {Object} options (Optional) An object containing one or more
cookie options: path (a string), domain (a string), expires (a Date object),
raw (true/false), and secure (true/false).
@return {String} The created cookie string.
@method set
@static
Sets a cookie with a given name and value .