session设置
@param string $name session名称
@param mixed $value session值
@param string|null $prefix 作用域（前缀）
@return void
506456
public function set($name, $value = '', $prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->prefix;
        if (strpos($name, '.')) {
            // 二维数组赋值
            list($name1, $name2) = explode('.', $name);
            if ($prefix) {
                $this->data[$prefix][$name1][$name2] = $value;
            }
            else {
                $this->data[$name1][$name2] = $value;
            }
        }
        elseif ($prefix) {
            $this->data[$prefix][$name] = $value;
        }
        else {
            $this->data[$name] = $value;
        }
        $this->hander->write($this->sessionID,serialize($this->data));
    }
1267946
public static function set($name, $value)
    {
        return (self::has($name) !== true) ? $_SESSION[$name] = $value : false;
    }
681839
protected function _sendHeader($name, $value = null)
    {
        deprecationWarning(
            'Will be removed in 4.0.0'
        );

        if ($value === null) {
            header($name);
        } else {
            header("{$name}: {$value}");
        }
    }
391581
public function offsetSet($offset, $value)
    {
        if ($offset === null) {
            $offset = count($this->session[$this->prefix]);
        }

        $this->session[$this->prefix][$offset] = $value;
    }
166417
public function set($name, $value)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        $context->is_dirty = true;
        $context->_SESSION[$name] = $value;
    }
593475
public static function set($name,$value=null)
    {
        if(is_array($name)){
            self::$config=array_merge(self::$config,$name);
            return;
        }
        if(strstr($name,'.')===false){
            self::$config[$name]=$value;
        }else{
            list($l,$r)=explode('.',$name);
            self::$config[$l][$r]=$value;
        }
    }
1122802
public function set($name, $value = '', $option = null) {

        // 参数设置(会覆盖黙认设置)
        if (!is_null($option)) {
            if (is_numeric($option)) {
                $option = ['expire' => $option];
            }
            elseif (is_string($option)) {
                parse_str($option, $option);
            }
            $config = array_merge($this->config, array_change_key_case($option));
        }
        else {
            $config = $this->config;
        }
        $name = $config['prefix'] . $name;
        // 设置cookie
        if (is_array($value)) {
            array_walk_recursive($value, 'self::jsonFormatProtect', 'encode');
            $value = 'nb:' . json_encode($value);
        }
        $expire = !empty($config['expire']) ? $_SERVER['REQUEST_TIME'] + intval($config['expire']) : 0;
        if ($config['setcookie']) {
            setcookie($name, $value, $expire, $config['path'], $config['domain'], $config['secure'], $config['httponly']);
        }
        $_COOKIE[$name] = $value;
    }
570914
public function create($name, $value = '')
    {
        $_SESSION[$name] = $value;

        if(isset($_SESSION[$name])) {

            return true;
        }

        return false;
    }
1247083
public function write($name, $value = null)
    {
        if (!$this->started()) {
            $this->start();
        }

        $write = $name;
        if (!is_array($name)) {
            $write = [$name => $value];
        }

        $data = isset($_SESSION) ? $_SESSION : [];
        foreach ($write as $key => $val) {
            $data = Hash::insert($data, $key, $val);
        }

        $this->_overwrite($_SESSION, $data);
    }
627636
public static function set(string $name, $value, string $namespace = '*'): void
    {
        self::initialize();
        $_SESSION[$namespace][$name] = $value;
    }
644173
public function setSessionValue($name, $value)
    {
        // In Laravel 5.4 the session changed to use their own custom implementation
        // instead of the one from Symfony. One of the changes was the set method
        // that was changed to put. Here we check if we are using the new one.
        if (method_exists($this->session, 'driver') && $this->session->driver() instanceof \Illuminate\Contracts\Session\Session) {
            $this->session->put($name, $value);
            return;
        }
        $this->session->set($name, $value);
    }
621718
public function write($name, $value) {
        $_SESSION = Hash::write($_SESSION, $name, $value);
        return $value;
    }
1007949
public function set($name, $value)
    {
        if (property_exists($this, $name)) {
            $this->$name = $value;

            return true;
        }

        return null;
    }
741133
public function delete($name, $prefix = null) {
        $config = $this->config;
        $prefix = is_null($prefix) ? $config['prefix'] : $prefix;
        $name = $prefix . $name;
        if ($config['setcookie']) {
            setcookie($name, '', $_SERVER['REQUEST_TIME'] - 3600, $config['path'], $config['domain'], $config['secure'], $config['httponly']);
        }
        // 删除指定cookie
        unset($_COOKIE[$name]);
    }
980491
public function set($name, $value = null)
    {
        if (is_array($name))
        {
            // 如果传入数组就合并当前数据
            $this->data = ArrayUtil::recursiveMerge($this->data, $name);
        }
        else
        {
            // 设置数据
            $this->data[$name] = $value;
        }
        return true;
    }
1216781
protected function setCookie($name, $value = '') {
    // Don't set cookies if this service is used via drush.
    if (PHP_SAPI === 'cli') {
      return;
    }

    if (isset(\Drupal::request()->cookies)) {
      \Drupal::request()->cookies->set("Drupal_visitor_{$name}", $value);
    }

    user_cookie_save([
      $name => $value,
    ]);
  }
1343608
private function setCookie(string $name, $value)
    {
        $expiry = $this->transient ? 0 : (time() + 2629743);
        $sessionParameters = session_get_cookie_params();
        setcookie(
            $name,
            $value,
            $expiry,
            '/',
            $sessionParameters['domain'],
            $this->secure,
            true
        );
    }