I am trying to set up a comment system, in which when the users sends the comment it is displayed on their screen as if it were already stored on the database. My question is: what would happen if the users send comments and then navigate away (or most specifically close the window immediately) or they lose connection after the ajax post?
On the code side I have ajax({})
...
Then I have code that takes the user input from the textarea and adds it to a div.
This means that the user gets to see the comment they entered instantaneously. But I would like to be sure if the server will get the post info even if the connection was lost, window was closed or the user navigated away.
More info for the question:
A user sends a post to the server with 1mb of values, then right after one millisecond he/she clicked on the button that made the post the browser window was closed.
Does the server receive and parse the response with ignore_user_abort(true);
inside the file; was the post info received?
Any difference if it were get instead of post for this case?
Assume website.com?myget=value
Trying to connect then closing the window immediately, on a browser window for example, just hitting that on the address bar and then closing very right away, imagine it to be automatically.
step 1 go to website.com?myget=value
(don't wait at all for any server response, just
straight away (a millisecond or whatever it takes the script to do so) close completely
the window.
Would $_GET['myget']
be received server side at index.php of website.com?