Ensure thread safety with session data.