Problem: After ajax asynchronously requests PHP background processing time-consuming tasks, the js after ajax can run normally, but the current browser can no longer click to browse other pages at the address requested by ajax (stuck, blocked) .
Solution:
First, the front end is normal ajax request.
Second, these three sentences must be added to the PHP background method:
ignore_user_abort(); //Detach from the client
set_time_limit(0); //Execute without time limit
session_write_close(); //Session unlock
session_write_close() is The important point is that the background execution is not completed and the session is locked, so session_write_close — Write session data and end session needs to be added.
The above introduces the time-consuming task session_write_close of ajax asynchronous request to PHP background processing, including the ajax content. I hope it will be helpful to friends who are interested in PHP tutorials.