# \[STEAM\] FindSession fails when in active session

**URL:** <https://forums.unrealengine.com/t/steam-findsession-fails-when-in-active-session/404127>\
**Category:** Platform & Builds\
**Tags:** steamworks, UE4-17, unreal-engine, Blueprint, question, CPP\
**Created:** [September 8, 2017, 8:59pm UTC](https://forums.unrealengine.com/t/steam-findsession-fails-when-in-active-session/404127 "2017-09-08T20:59:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valkyrie\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Valkyrie\_1](https://forums.unrealengine.com/u/Valkyrie_1)\
**Post date:** [September 8, 2017, 8:59pm UTC](https://forums.unrealengine.com/t/steam-findsession-fails-when-in-active-session/404127/1 "2017-09-08T20:59:14Z")

</div>

In UE 4.17 EFindLobbiesState::WaitForRequestLobbyData fails to find lobby/session data if in an active session. Any fix for this? I seems to be a miscount between LobbyIDs.Num() & SessionInt-\>PendingSearchLobbyIds.Num()

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2a2e82c6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2a2e82c6](https://forums.unrealengine.com/u/anonymous_user_2a2e82c6)\
**Post date:** [September 21, 2018, 1:00am UTC](https://forums.unrealengine.com/t/steam-findsession-fails-when-in-active-session/404127/2 "2018-09-21T01:00:04Z")

</div>

Seeing the same thing on 4.20.

---

<div class="post-metadata">

**Author:** ![dameda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dameda](https://forums.unrealengine.com/u/dameda)\
**Post date:** [September 17, 2022, 3:59am UTC](https://forums.unrealengine.com/t/steam-findsession-fails-when-in-active-session/404127/3 "2022-09-17T03:59:16Z")

</div>

Seeing the same thing on 4.27.

I’m writing this down in case anyone still has this problem.

I added my netid to the extra setting when creating a session, and excluded the server player’s netid when doing findsession.  
If I do this, it will be searched even in the active session.

---

<div class="post-metadata">

**Author:** ![M.Capousek](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/m.capousek/32/88715_2.png) [@M.Capousek](https://forums.unrealengine.com/u/M.Capousek)\
**Post date:** [November 29, 2022, 1:39pm UTC](https://forums.unrealengine.com/t/steam-findsession-fails-when-in-active-session/404127/4 "2022-11-29T13:39:45Z")

</div>

We fixed it with following modification:

```auto
	bool IsMemberOfLobby(const FUniqueNetIdSteam& LobbyId)
	{
		FScopeLock ScopeLock(&JoinedLobbyLock);

	#if !ENABLE_CUSTOM_ENGINE_CHANGES
		return JoinedLobbyList.Find(LobbyId.AsShared()) != INDEX_NONE;
	#else

		// It seams that 'FUniqueNetIdSteam.AsShared()' is somehow broken or probably can't be used this way
		// because 'JoinedLobbyList.Find()' returns 'INDEX_NONE' even for IDs that are present in the list.
		// 
		// Maybe this method should in stead of 'FUniqueNetIdSteam' accept 'FUniqueNetIdSteamRef' because
		// currently all use cases works that way.

		for (int i = 0; i < JoinedLobbyList.Num(); i++)
		{
			if (*JoinedLobbyList[i] == LobbyId)
				return true;
		}
		return false;

	#endif
	}

```
