However, if the cookie consists of a username and a random number, the previous strategy is no longer feasible. The Cartesian product of usernames and random numbers from a large field is too great a set to consider attacking. An attacker's only hope in this implementation would be sniffing or MitM attacks (which I should add are much scarier than brute force attacks).
Once you push the odds of some event below the noise threshold of CPU error, it ceases mattering, because you've pushed past the point where you can't do anything about it anyhow anymore. CPUs are very reliable but their failure probability is not 0.
> When the cookie does not contain the username, you, the server, need to look up in your table to whom you gave the random number.
When the cookie does contain the username, I have to look up whether that random number is valid for the given username. How is that better?
Why not just use a random number on its own? There's no reason I can see to bother with the username.