Sessionid Uniquness Question

How unique is the session ID that Yii 1.x uses?

In my application I want to use the session id Yii::app()->session->sessionID as a simple way to track a users path though a few pages on the site. So on each page I will write a record to the db with the session id and some tracking info. So the question is -

How unique is it for a single server?

How unique is it for multiple severs?

This is more for analytics use not concerned with sessions security



You shouldn’t worry about the session id being duplicated, chances are extremely low, almost impossible.

See here for a detailed discussion:

Thanks, I had come across that article as well. Didn’t know if Yii did anything different. I looked at Yii’s session code and didn’t see any changes to the default hash so for my instance it looks to be MD5. Unless the random number is a repeat (from dev/urandom) I’m thinking it should be fine.

I guess the time stamp also will indicate a dupe if they differ much more then the session tko it’s not really the same session.

Thanks for the quick response!