Simple single sign-on

Problem: The same main domain name, but different subdomains. For example, xw.xinwen.com and zgl.xinwen.com, one is logged in, the other does not need to be logged in

Idea: Just realize cookie sharing

Solution: setcookie($key, $value, $exp_time,'/','.xinwen.com'); //Pay attention to the " . " in ".xinwen.com "

effect:

 

Guess you like

Origin blog.csdn.net/weixin_38230961/article/details/109618507