开发者

how to know from a Site B, if the user is connected on the site A?

开发者 https://www.devze.com 2023-04-10 00:13 出处:网络
I have got a website and now i have to add a forum. The forum will be on a sub-domain of the site, but may be on an 开发者_如何学Goother server.

I have got a website and now i have to add a forum. The forum will be on a sub-domain of the site, but may be on an 开发者_如何学Goother server.

The user must sign-in only from the website, to be connected on the forum. If the user try to see the forum without sign-in on the website, , he'll be redirect to the the sign-in page form the website, if he is yet connected from the website, he'll can see the site.

My question is how to kwow on the forum ,if there is a session open by the user on the website??? how do they both communicate ? (cookies stuff?, webservice?, and how?)


Cookies can be saved on the entire domain, thus allowing subdomains to read them.

setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1);

.example.com should be replaced with your domain.

http://php.net/manual/en/function.setcookie.php


Single Sign-On?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号