Server side processing of web requests
Situation: a user clicks on a link, the server receives a request and starts processing it. Meanwhile the user clicks on another link, the server receives a new request while processing the first. What's happening? On the client side, we only see the webpage from the second request, but is this the process from the first request killed on the server when the second is received? And is it server or language driven (Apache or PHP)?
Depends. Unless the browser disconnects the connection to the server, it has absolutely no idea that the client has moved to a different location. If it disconnects the connection, then up to the webserver select it to detect and interrupt the processing flow or not.
Either way, that's the nature of HTTP statelessness. You should not rely on anything in this regard.
a source to share
You can use ignore_user_abort()
to tell the script to continue (or not) after the connection has been completed.
a source to share