Our application is using ASP.net MVC and we have a question on what happens in the below scenario.
We have a “button” which makes a payment and after making a payment we have a session variable which marks “PaymentSubmitted” to True. This session variable will be used to do different stuff based on it’s value.
Now I would like to have your inputs in deciding what happens if the user clicks on that “button” twice.
Will the second request (generated from second click of the finish button) wait till the first request is executed ? Or will the second request will move on without worrying much on where is the first request.
note: we refrain from using any client side scripting.
I’m assuming the button click is a “submit” on a form.
Once the button is clicked, a second request WILL get posted. Just imagine, you hit the refresh on your browser on any given page 20 times, those 20 requests are going to be sent to your web server and will be handled in the order that they are received.
You should be able to check the session variable on the subsequent click if you’ve set it early enough – but this is definitly not safe.
The better approach would be to use JavaScript or post to a different page so that the button is not able to be clicked again while taking payment.