How do I stop Players from joining a LAN session after some amount of time?

For my multiplayer game I want there to be a limited timeframe for Players to join a session after it has been created. After that time has elapsed, it should either be immpossible for Players to join the session or the session shouldn’t get listed in the search results. How would you go about doing that?