Answer the question
In order to leave comments, you need to log in
How unique is the session ID?
Good afternoon.
There is such a question - where is the limit of the uniqueness of the session id? Knowing that in practice it is almost impossible to guess it, where can be the limit beyond which the generated sessions will begin to repeat?
Let's say the table has a session_id field that stores the actual user session ID. Each new guest is one new entry. Can this lead to duplicate records appearing in the table sooner or later?
Answer the question
In order to leave comments, you need to log in
In theory, yes, of course. If 2 ^ 128 degrees of people (devices) come to you in one second, then the likelihood of dubbing will appear ... however, it is worth recognizing that at this moment you will have other problems. For example, where to get the resources to process such traffic
In practice, yes, it will definitely happen. The question is after how much ... after all, there is an insignificant fraction of the probability that after 1 -2 minutes.
And following the logic, if such an event is possible, then it cannot be used as a key field.
I would add a timestamp to the session_id. This will be a truly unique value.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question