Front-end address:
http://a1.domain.com/login.html
backend address:
http://b2.domain.com/login.php
when the frontend logs in, the ajax request is sent to the backend for verification, and the request returns a correct user name and password, and then jumps to the home interface. However, when the home interface requests the backend data, the backend cannot obtain the login status through cookie due to cross-domain name reasons, so it still returns to the login interface.
then I set cookie cross-domain when the backend php login is successful, but not yet. The code is as follows:
//
setcookie("uid", "123", 0, "/", "a1.domain.com", 0);
setcookie("uid", "123", 0, "/", "domain.com", 0);