Use a function to find a free Session ID instead of just incrementing a counter.