设置session, 支持批量
@param string | array $key 键
@param mixed $value 值
@return bool
356224
public function set($key, $value)
    {
        //初始化会话
        yield $this->start();

        $data = yield $this->sessionHandler->read($this->sessionId);
        if (!$data) {
            $data = [];
        } else {
            $data = json_decode($data, true);
        }

        if (is_array($key)) {
            $data = array_merge($data, $key);
        } else {
            $data[$key] = $value;
        }

        return yield $this->sessionHandler->write($this->sessionId, json_encode($data));
    }
725731
public static function set($key, $value = false)
    {

        /**
         * Check whether session is set in array or not
         * If array then set all session key-values in foreach loop
         */

        self::setPrefix();

        if (is_array($key) && $value === false) {

            foreach ($key as $name => $value) {
                $_SESSION[self::$_sessionPrefix . $name] = $value;
            }

        } else {
            $_SESSION[self::$_sessionPrefix . $key] = $value;
        }

    }
741777
public function session($value)
    {
        if (!isset($this->session[$value])) {
            return false;
        } else {
            return $this->session[$value];
        }
    }
788104
public static function set($key, $value = '')
    {
        empty(self::$prefix) && self::$prefix = Config::get('session_prefix');
        if (!is_array($key)) {
            $_SESSION[self::$prefix . $key] = $value;
        } else {
            foreach ($key as $k => $v) {
                $_SESSION[self::$prefix . $k] = $v;
            }
        }
        return true;
    }
298058
public function put($key, $value = null)
    {
        if (!is_array($key)) {
            $key = [$key => $value];
        }

        foreach ($key as $arrayKey => $arrayValue) {
            Arr::set($_SESSION, $arrayKey, $arrayValue);
        }
    }
1121959
public function set(CacheKey $key, $value, /** @noinspection PhpUnusedParameterInspection */
                        $sessionLength = null) {

		$this->cache [$key->getModule()] [$key->getProperty()] = $value;

		return true;
	}
525245
public function flash($key, $value = true)
    {
        if (is_array($key))
            $this->flashMany($key);
        else
            $this->session->flash($key, $value);
    }
957110
public static function set($key, $value, $options = []) {
		// store value in session
		if (!empty($options['session'])) {
			$key = array_key_convert_key($key);
			array_unshift($key, 'registry');
			array_unshift($key, 'numbers');
			\Session::set($key, $value);
		}
		array_key_set(self::$settings, $key, $value);
	}
243699
public function set($key, $value) {

        $keys = \explode('/',$key);

        if (\count($keys)>5) return false;

        switch (\count($keys)){

          case 1:
            $this->registry[$keys[0]] = $value;
            break;

          case 2:
            $this->registry[$keys[0]][$keys[1]] = $value;
            break;

          case 3:
            $this->registry[$keys[0]][$keys[1]][$keys[2]] = $value;
            break;

          case 4:
            $this->registry[$keys[0]][$keys[1]][$keys[2]][$keys[3]] = $value;
            break;

          case 5:
            $this->registry[$keys[0]][$keys[1]][$keys[2]][$keys[3]][$keys[4]] = $value;
            break;
        }

        return $this;
    }
168880
public static function set(string $key, $value)
    {
        // Start session if needed
        if (! session_id()) {
            self::start();
        }

        // Set key
        $_SESSION[(string) $key] = $value;
    }
669714
protected function setSessionData(string $key, ?string $value = null)
    {
        if (!$value) {
            unset($_SESSION['key']);
            return;
        }

        $_SESSION[$key] = $value;
    }
11077
public function set($key, $value)
    {
        $setter = 'set'.ucfirst($key);

        if (is_array($this->current)) {
            $this->current[$key] = $value;
        } elseif ($this->isObjectWithMethod($this->current, $key)) {
            $this->current->$key($value);
        } elseif ($this->isObjectWithMethod($this->current, $setter)) {
            $this->current->$setter($value);
        } elseif ($this->isObjectWithMethod($this->current, 'set')) {
            $this->current->set($key, $value);
        } elseif (is_object($this->current)) {
            $this->current->$key = $value;
        } else {
            return false;
        }

        return true;
    }
531333
final public function setData($key, $value)
    {
        if (empty($key)) {
            return false;
        }
        $this->data = \WebServCo\Framework\ArrayStorage::set($this->data, $key, $value);
        return true;
    }
1299452
public function set($key, $value)
    {
        if ($this->isTemporary($key)) {
            $this->_temporaryState[$key] = $value;
        } else {
            $state = Yii::$app->session[self::SESSION_STATE_KEY];
            if (empty($state)) {
                $state = [];
            }
            $state[$key] = $value;
            Yii::$app->session[self::SESSION_STATE_KEY] = $state;

            return true;
        }

        return false;
    }
707265
public function set($key, $value)
    {
        $config = &$this->config;

        foreach (explode('.', $key) as $k) {
            $config = &$config[$k];
        }

        $config = $value;

        return true;
    }
1151340
public function set($key, $value)
    {
        $allowed = array_diff(array_keys(get_class_vars(get_class($this))), $this->_hidden);
        if (empty($allowed) || !empty($allowed) && in_array($key, $allowed)) {
            if (method_exists($this, 'set' . ucfirst($key))) {
                call_user_func_array([$this, 'set' . ucfirst($key)], [$value]);
            } else {
                $this->{$key} = self::modelize($key, $value);
            }
        }

        return $this;
    }
430380
public static function set(string $key, $value) : void
    {
        $_SESSION[Notification::SESSION_KEY][$key] = $value;
    }