core/Request.php
public static function getSession(string $name = null, $def = null)
    {
        if (session_status() !== PHP_SESSION_ACTIVE) {
            session_start();
        }
        if (empty($name)) {
            return $_SESSION;
        }
        return isset($_SESSION[$name]) ? $_SESSION[$name] : $def;
    }
public static function getSession(string $name = null, $def = null)
    {
        if (session_status() !== PHP_SESSION_ACTIVE) {
            session_start();
        }
        if (empty($name)) {
            return $_SESSION;
        }
        return isset($_SESSION[$name]) ? $_SESSION[$name] : $def;
    }
获取 session 相当于 $_SESSION[$name]
@param string|null $name
@param null $def
@return null