About the problem that the page in the iframe cannot set cookies (sessions)
header('Set-Cookie: cross-site-cookie=name; SameSite=None; Secure'); setcookie('cross-site-cookie', 'name', ['samesite' => 'None', 'secure' => true]); //This method seems feasible, but it needs to have a base class in the project, which can be set uniformly session_set_cookie_params(['samesite' => 'None', 'secure' => true]); $currentCookieParams = session_get_cookie_params(); $cookie_domain= 'your domain'; if (PHP_VERSION_ID >= 70300) { session_set_cookie_params([ 'lifetime' => $currentCookieParams["lifetime"], 'path' => '/', 'domain' => $cookie_domain, 'secure' => "1", 'httponly' => "1", 'samesite' => 'None', ]); } else { session_set_cookie_params( $currentCookieParams["lifetime"], '/; samesite=None', $cookie_domain, "1", "1" ); } session_start(); //Waiting for verification