How to seperate input value if multiple user submits data at the same time?

In case of Multiple Choice Questions 100 students may submit their answers and some of them may (in case) submit same question and answers at the same time. I am willing to know, in this type of case how programmers make sure same variable do not conflict with input data? and each remains to its associate users?

Same situation may occur in case of eCommerce system, accessing same product and ordering at the same time, I know the possibility of ‘same time’ is next to impossible but what happen if it happens?

Each http(s) request to a web server is handled by a separate instance/process of/on the web server. Input data and program variables for each request exist in their own instance/process of/on the web server.

To store data per user, you would have a user authentication/login system that stores the user’s id in a session variable. You would require the user to be logged in in order to use a student quiz or submit an order in an ecommerce system. You would store the user id from the session variable with any data related to the user.

Sponsor our Newsletter | Privacy Policy | Terms of Service