The probability that session_id of different browsers is the same is ???? Session_id duplicate session cookie
What I always know is that session_id is absolutely unique.
However, during session sharing for a second-level domain name, the user finds a problem: the user saves the session_id to the cookie during the first access, sets the cookie validity period to one day, and then the user exits. 30 minutes later, the session of the server is destroyed, and the user carries the session_id stored in the cookie for access .. On the server side, for the second-level domain name to share session_id, make a judgment: as long as $ _ COOKIE ['session _ id'] exists, use session_id () the function directly accesses the session of the server ..
The problem arises. at this time, the session_id passed by the user, the corresponding session has been destroyed. At this time, is there a session on the server, and its session_id happens to be the $ _ COOKIE ['session _ id'] transmitted by the user ???
Note: after the server destroys a session, the session_id corresponding to the session is ignored. Then the server may generate this session_id and allocate it to another session.
Thank you !!!!!
Reply to discussion (solution)
Session_id is a time-related value. as long as the Earth is still in conversion, there will be no duplicates.
Time is an incremental value, so the past time cannot appear in the future. But isn't session_id a string of letters and numbers? is there a possibility of repetition in the arrangement and combination ??
Session_id is a time-related value. as long as the Earth is still in conversion, there will be no duplicates.
A number is generated every microsecond. 8 bytes can be used in 100. after one hundred years, will the computer be a computer?