set = function (name, value, option) {

            option = option || {};

            //session cookie as default
            var expires = option.expires;

            // delete the cookie data while value is equal to null
            if (value === NULL) {
                expires = -1;
            }

            // overflow judgement
            if (expires !== -1) {
                var newCookie = DOC.cookie,
                    matchedCookie = newCookie.match('(?:^|; )' + name + '(?:(?:=([^;]*))|;|$)'),
                    setCookie = '; ' + name + '=' + value; // Cookie will be set

                /*if (name !== COOKIENAME && setCookie.length > EACHMAXLENGTH) {
                    // error callback
                    option.error && option.error();
                    // refuse to write cookie when it's overflow
                    return false;
                }*/

                // imitate the new cookie data before writing
                if (matchedCookie) {
                    newCookie = /^;/.test(matchedCookie[0]) ? newCookie.replace(matchedCookie[0], setCookie) : newCookie.replace(matchedCookie[0], name + '=' + value);
                } else {
                    newCookie += setCookie;
                }

                if (newCookie.length > MAXLENGTH) {
                    // error callback
                    option.error && option.error();
                    // refuse to write cookie when it's overflow
                    return false;
                }
            }

            // Write cookie
            DOC.cookie = [
                name, '=',
                value,
                expires ? '; expires=' + toExpires(expires) : '',
                notEmpty(option.domain) ? '; domain=' + option.domain : '',
                notEmpty(option.path) ? '; path=' + option.path : '',
                option.secure ? '; secure' : ''
            ].join('');
        }
Set cookie (original usage)
@param {String} name   Cookie's name
@param {String|Number} value  Cookie's value
@param {Object} Option options