Mysql
 sql >> Database >  >> RDS >> Mysql

Stesso login su 2 siti web

Stai cercando uno script Single Sign-On usando PHP. Questo è il termine che devi cercare. Un modello semplice sarebbe:

Sito:http://auth.local/ :

<?php
  // Get the request.
  // Validate the session.
  // Pass a Secure Hash and log the user in to the main domain.
?>

Sito:http://site1.local/ :

<?php
  // Check if there is a session.
  // If already logged in, no problem.
  // If not, send him back to auth.
  header("Location: http://auth.local/?redirect_to=http://site1.local/");

Sito:http://site2.local/ :

<?php
  // Check if a session is there.
  // If already logged in, no problem.
  // If not, send him back to auth.
  header("Location: http://auth.local/?redirect_to=http://site2.local/");

Vedi le risposte alla domanda Come fare single sign-on con PHP? per maggiori informazioni.