Write data into fe_user session

@param string $key
@param mixed $data
@param string $type - possible values: ses|user
505396
public static function set($key, $data, $type = 'ses')
    {
        $GLOBALS['TSFE']->fe_user->setKey(self::isType($type), $key, serialize($data));
        $GLOBALS['TSFE']->fe_user->storeSessionData();
    }
23730
public function setTemplate(array $data, string $key): void
  {
    $this->templateData = $data;
    $this->templateKey  = $key;
  }
135286
protected function cacheData($key, $data, $config = [])
    {
        $this->cache->set($key, $data, $config['expire']);
    }
961207
public function write($key, $data) {
        $cache = Zend_Registry::get('CacheFrontend');
        // include the current version in the cached results
        $version = (int)$cache->load($this->_versionKey);
        // save the data to cache but include the version number
        return $cache->save(
            array(
                'data' => $data,
                'version' => $version
            ),
            $key
        );
    }
1154632
public static function set($key,$data,$period=0,$type='sys'){
        /**
         * 初始化
         */
        self::init($key,$data,$period);
        /**
         * 判断缓存类型
         *  注意自动加载无法通过use 命名空间加载，只能拼接
         */

        $class = 'pizepei\model\cache\drive\\'.ucfirst(self::$config['driveType']);
        $class::$typeCache = $type;
        return $class::set(self::$key,self::$data,self::$period,self::$config);
    }
117265
public function get($type, $key)
    {
        if (array_key_exists($key, self::$store)) {
            //TODO: implement expiration check
            // implement data type check?
            return self::$store[$key]['value'];
        }
        return null;
    }
111900
public function activate($type, $key)
    {
        // Load
        $json = $this->load();
        unset($json[$type]["elements"][$key]["hidden"]);
        $this->sortJson($json);
        $this->write($json);
    }
598049
public function set($key, $data) {
        if ($this->persist) {
            $this->store[$key] = $data;
        }
        return true;
    }
620568
public static function register($key, $value, $data = [])
    {
        if (!self::_tableExists()) {
            return;
        }

        self::autoLoad();

        $_data = [
            'value' => $value,
            'editable' => 1,
            'autoload' => true,
            'options' => [],
            'description' => null,
        ];

        $data = array_merge($_data, $data);

        // Don't overrule because we register
        $data['overrule'] = false;

        self::options($key, $data['options']);

        self::write($key, $data['value'], $data);
    }
456654
protected function _execute($type, $data)
    {
        if (!isset($this->_handles[$type]))
        {
            $this->_tmp_handles = array();
            $path = \Swoole::$app_path.'/events/'.$type.'.php';
            if (is_file($path))
            {
                $_conf = include $path;
                if ($_conf and isset($_conf['handlers']) and is_array($_conf['handlers']))
                {
                    foreach ($_conf['handlers'] as $h)
                    {
                        if (class_exists($h))
                        {
                            $object = new $h;
                            if ($object instanceof IFace\EventHandler)
                            {
                                $this->_tmp_handles[] = $object;
                                continue;
                            }
                        }
                        trigger_error("invalid event handler[$type|$h]", E_USER_WARNING);
                    }
                }
            }
            $this->_handles[$type] = $this->_tmp_handles;
        }

        foreach($this->_handles[$type] as $handler)
        {
            /**
             * @var  $handler  IFace\EventHandler
             */
            $handler->trigger($type, $data);
        }
        return true;
    }
1371999
public static function get($key, $type = 'ses')
    {
        $sessionData = $GLOBALS['TSFE']->fe_user->getKey(self::isType($type), $key);

        return unserialize($sessionData);
    }
1066091
public function add(TypeInterface $type, $key = null)
    {
        $this->types[!is_null($key) ? $key : get_class($type)] = $type;
    }
1025485
public function put($key, $data)
    {

        $key = $this->getKeyCode($key);
        $data = json_encode($data);
        $this->memcacheObj->set($key, $data);
    }
322061
protected function writeCache($key, &$data, $lifetime)
    {
        $this->cacheManager->set($key, $data, [], $lifetime);
    }
1342801
private function debug($type, $key, $data = null, $result = null)
    {
        $line = strtoupper($type) . ' ' . $key;

        if ($data !== null) {
            $line .= ' ' . ($this->packed ? $data : serialize($data));
        }

        rcube::debug($this->type, $line, $result);
    }
809083
public function write($text, $type = 'stdout')
    {
        if (in_array($type, ['stdout', 'stderr']) && ! empty($text)) {
            $f = fopen('php://' . $type, 'w');

            if (is_array($text)) {
                $text = json_encode($text);
            }

            fwrite($f, $text);
            fclose($f);
        }
    }
977037
public function write($key, $data)
    {
        $this->_cachedData[$key] = $data;
        Cache::set('model-metadata', $this->_cachedData, Cache::TTL_ONE_MONTH);
    }