Sie suchen nach einem Single-Sign-On-Skript mit PHP. Das ist der Begriff, nach dem Sie suchen müssen. Ein einfaches Modell wäre:
Website:https://auth.local/ :
<?php
// Get the request.
// Validate the session.
// Pass a Secure Hash and log the user in to the main domain.
?>
Website:https://site1.local/ :
<?php
// Check if there is a session.
// If already logged in, no problem.
// If not, send him back to auth.
header("Location: https://auth.local/?redirect_to=https://site1.local/");
Website:https://site2.local/ :
<?php
// Check if a session is there.
// If already logged in, no problem.
// If not, send him back to auth.
header("Location: https://auth.local/?redirect_to=https://site2.local/");
Siehe die Antworten auf die Frage Vorgehensweise Einmaliges Anmelden mit PHP? für weitere Informationen.