Cross-primary domain to realize the idea of SSO
The same primary domain (that is: all sub-domains under the same first-level domain name) including multi-server sharing session data implementation of many methods, here is not much to say!
The key issue now is the implementation of SSO for different primary domains! This problem is more complex, can be achieved, but many are supported by a number of special software systems ...
In fact, the session is also required to support the cookie, the cookie does not support cross-primary domain determines that the session cannot cross the primary domain! So, how to implement cross-primary domain???
This is another simple way that I suddenly thought of when I realized SSO in my project, for everyone to discuss
First, fake with A.com, B.Com, c.com the three main domains, of which a.com is mainly responsible for verifying the pass (faster), B.Com and c.com are specific applications
Second, B.Com and c.com and a.com some of their own applications need to a.com to gain trust (login)
Third, assign a subdomain passport to each primary domain. B.Com, Passport. c.com, their IP is pointing to the host address where the a.com resides.
Four, the user in the login through verification, set up a jump rule to session_id as a parameter, one by one to jump Passport. B.Com, Passport. C.com (in fact, these subdomains can be established to a host of the default site, through the array and some parameters can be quickly jump), jump directly with the PHP header ("location:passport.b.com/?sid=xxxxxxxx&i=0"); , at the same time, the session_id of the current master domain is overwritten by the session_id to pass over.
Here are some considerations:
1, will each passport. X.com assigned to the same speed on the host, facilitates fast jump, and the user can not see the process of complex jump ...
2, the same host on the jump can avoid the intermediate jump link error caused jump failure.
I only tested on the native simulation multi-master domain, the effect is good; there is no specific experiment on the Internet, please have time to try it out and propose a better SSO solution ...
http://www.bkjia.com/PHPjc/735114.html www.bkjia.com true http://www.bkjia.com/PHPjc/735114.html techarticle cross-primary domain, realize the idea of SSO the same primary domain (i.e., all subdomains under the same first-level domain name) includes multi-server sharing session data implementation of many methods, there is not much to say! ...