code: function() {
              if (typeof obj.expires === 'number') {
                  var date = new Date();
                  date.setTime(date.getTime() + obj.expires * 60 * 1000);
                  var expiresDate = date.toUTCString();
              } else {
                  delete obj.expires;
              }
  
              if (obj.json) {
                  obj.value = JSON.stringify(obj.value);
              } else if (! obj.raw) {
                  obj.value = encodeURIComponent(obj.value);
              }
  
              var setCookie = obj.name + '=' + obj.value + ';'
                  + (obj.expires ? 'expires=' + expiresDate + ';' : '')
                  + (obj.path ? 'path=' + obj.path + ';' : '')
                  + (obj.domain ? 'domain=' + obj.domain + ';' : '')
                  + (obj.secure ? 'secure;' : '');
  
              return (document.cookie = setCookie);
          }
docs: Set cookie