Substitute whatever searching method you're using, of course. And there are a lot of ways this will look different depending on what else you're doing. But this should show you how to use the session hash to your advantage.