Cml\Http\Session::set PHP Method

set() public static method

设置session值
public static set ( string $key, string $value = '' ) : string
$key string 可以为单个key值,也可以为数组
$value string value值
return string
    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;
    }