The realization of the login status synchronization based on Session under ThinkPHP 3.2.3beta version, and the notification of login and logout is sent based on UCenter
Because passport.xxx.com and soft.xxx.com are two secondary subdomains of xxx.com, in the case of both processing exit status, the Send a synchronization login notification through ucenter to realize login, but in many cases, passport.xxx.com and soft.xxx.com may One is the login status, the other is the logout state; at this time, you need to realize the synchronization of the login status, otherwise click the login link to the passport. xxx.com, because the passport is a login state, the login page is not allowed to open by default, so the soft cannot be logged in through the passport. Only after the Passport can be logged out and logged in again, both Passport and soft can be logged in; so the implementation process is as follows:
The configuration in conf.php in passport.xxx.com is as follows:
/* Session and cookie configuration */
session_options => array(domain=>.hmwis.com), // Session Configuration Array Supports Type Name ID Path Expire Domain and other parameters
session_prefix=>passport_home, //Session prefix
cookie_prefix =>passport_home_, // cookie prefix Avoid conflicts
The configuration is as follows in conf.php in soft.xxx.com:
/* Session and cookie configuration */
session_options => array(domain=>.hmwis.com), // Session Configuration Array Supports Type Name ID Path Expire Domain and other parameters
session_prefix=>SOFT_HOME, //Session prefix
cookie_prefix =>SOFT_HOME_, // cookie prefix Avoid conflicts
In this way, the passport.xxx.com and $_session in soft.xxx.com are printed separately, which are exactly the same:
Finally, in soft.xxx.com, the synchronous login status processing is realized:
is_login() is the current application login user ID; is_passport_login() is the passport login user ID; if it is an exit status, it is 0;

