code: public function set($key, $value, $time = 0)
      {
          if (is_array($key)) {
              foreach ($key as $k => $v) {
                  setcookie($k, $v, ($time == 0 ? 0 : time() + $time), '/');
                  $_COOKIE[$k] = $v;
              }
          } else {
              setcookie($key, $value, ($time == 0 ? 0 : time() + $time), '/');
              $_COOKIE[$key] = $value;
          }
  
          return;
      }
docs: Set cookie method.
  
  @param string  $key
  @param string  $value
  @param integer $time
  
  @return void