I'm using Python 2.5 on Linux, in multiple parallel FCGI processes. I use
chars = string.ascii_letters + string.digits
cookie = ''.join([random.choice(chars) for x in range(32)])
to generate distinct cookies. Assuming that the RNG is seeded from /dev/urandom, and that the sequence of random numbers comes from the Mersenne twister, I would expect that there is practically zero chance of collision.
However, I do see regular collisions, even though only a few (<100) users are logged in at any time.
Why are the random numbers not more random?