In a word, it is possible to bring different domain names back to the same authentication information.
The way to do this is to put one of the authentication information stored in a different domain under a cookie after landing,
When verifying whether or not to log in, the cookie is validated, and if it is a subdomain, this is set to the top of the scope directly with the cookie.
The following is a different domain name, which is the use of script function, respectively, to visit each page, such as domain name:
Www.a.com
Www.b.com
Www.c.com
Each domain name is delegated a index.php file for verification purposes,
The index.php test code is as follows:
<?phpprint_r ($_cookie);//Here the information in the cookie is parsed, and if the validation is passed, the generated cookie is written to the appropriate domain name?>
Assume that the unified landing page is
www.c.com/login.php,www.c.com/do.php first front-end verification, if correct, allows the submission of
The login.php code is as follows
<?phpsession_start ();? ><! DOCTYPE html>
The do.php code is as follows:
<?php$redirect = Empty ($_request[' redirect ')? ' http://www.a.com ': $_request[' redirect '];if (Empty ($_request[' username ']) | | empty ($_request[' password '])) { Header (' loaction:http://'. UrlDecode ($redirect)); Exit;} $urls = Array ( ' www.a.com/a.php ', ' www.b.com/a.php ', ' www.c.com/a.php ');? ><! DOCTYPE html>
This allows direct access to the www.a.com/www.b.com/www.c.com to obtain cookie information.
The above is the basic principle, in each page to verify the judgment can be directly used, the general domain name is small,
Enough to use, generally not too many domain names
SSO Single Sign-on