The probability that session_id of different browsers is the same is ????

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.