Conditions: There is a third-party website, and every step of the operation needs to be logged in. Now I have built a simple front-end page and used PHP to make a springboard in the middle.
Process: Every request on the page I built is transmitted to the PHP springboard through ajax, and then the PHP springboard uses curl to simulate operations to request and transfer data to the third-party website. I store the session information in the database, and then retrieve it from the database before each curl operation, and then carry it with curl.
Problem: Third-party websites have login expiration restrictions. So one of my operations here may have failed because the session with the third-party website has expired.
Requirement: After PHP receives the information that a certain session has expired, it will automatically perform the login operation and continue the previously failed request.
My current method is to record each request action and data into a static variable, and then use call_user_func_array() to call it again after logging in again, but each operation cannot be completed, and it can only be done This step of automatic login cannot be completed by subsequent re-calls. do not know why. I hope the Great God Gate can give me some advice. Thanks!