in reply to saving a random number while generating a new one
One good way to handle things like this is to generate a small “pool” of random values which is then stored in the session-state. Numbers are withdrawn from the pool until it is empty, at which time it is reloaded. This may also enable you to recall the random numbers that were previously issued. And, they are, indeed, (pseudo-)random.