The idea of implementing SSO across primary domains _php tutorial

Source: Internet
Author: User
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! ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.