public static function get(string $key)
    {
        // Start session if needed
        if (! session_id()) {
            self::start();
        }

        // Fetch key
        if (Session::exists((string) $key)) {
            return $_SESSION[(string) $key];
        }

        // Key doesn't exist
        return null;
    }
public static function get(string $key)
    {
        // Start session if needed
        if (! session_id()) {
            self::start();
        }

        // Fetch key
        if (Session::exists((string) $key)) {
            return $_SESSION[(string) $key];
        }

        // Key doesn't exist
        return null;
    }
public static function get ( string $ key ) { // Start session if needed if ( ! session_id ( ) ) { self :: start ( ) ; } // Fetch key if ( Session :: exists ( ( string ) $ key ) ) { return $ _SESSION [ ( string ) $ key ] ; } // Key doesn't exist return null ; }
Gets a variable that was stored in the session.

echo Session::get('user');

@param  string $key The key of the variable to get.
@return mixed
Gets a variable that was stored in the session .