fix up the random number generator for session and token