{"size": 703, "ext": "js", "max_stars_repo_path": "SCMS-admin/src/main/resources/static/js/demo/cookie-Utils.js", "max_stars_repo_name": "BobSimon/SCMS", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "SCMS-admin/src/main/resources/static/js/demo/cookie-Utils.js", "max_issues_repo_name": "BobSimon/SCMS", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "SCMS-admin/src/main/resources/static/js/demo/cookie-Utils.js", "max_forks_repo_name": "BobSimon/SCMS", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.6764705882, "max_line_length": 77, "alphanum_fraction": 0.5419630156}
/**
 * set cookie
 * @param cname
 * @param cvalue
 * @param time 毫秒
 */
function setCookie(cname,cvalue,time){
    if(time == null){
        document.cookie = cname+"="+cvalue+"; "
    }else {
        var d = new Date();
        d.setTime(d.getTime()+time);
        var expires = "expires="+d.toGMTString();
        document.cookie = cname+"="+cvalue+"; "+expires;
    }

}

/**
 *  get cookie
 * @param cname
 * @returns {string}
 */
function getCookie(cname){
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++) {
        var c = ca[i].trim();
        if (c.indexOf(name)==0) { return c.substring(name.length,c.length); }
    }
    return null;
}

