Off topic but somewhat funny...
I'm not sure of the exact algorithm but I'm pretty sure that there is some randomness in addition to using the system time in milliseconds. However, I can tell you that a while ago there was a bug issued from a customer that was very upset that the session id contained a
word that most English speaking people would understand is not a word used in polite company. The funny thing was that it really
was getting generated randomly. WLS engineering was required to eliminate the ability for the algorithm to generate these words. I think the solution was to remove some letters like, oh, "f" from the algorithm.