Make createSession() a static function