Hi all;
I have a few sites which will share a centralized forum (completely comply with the license agreement). These sites have different domains (for example: sitedomain1.com, sitedomain2.com, forumsdomain.com) and I need to have cookies set to all three domains when a user tries to login to the forum and redirected back to 'where they came from'. The purpose of it is because I need to have the sites share the same user base and thus it'd be silly to get the user to login multiple times.
After some hair pulling, I've managed to code a small function which allows me to connect to the main db server, and verify the info user posted through a form, however, the cookies are giving me a headache right now... right now, I have made this custom function
Code:
function mySetcookie($name, $value) {
$expire = time() + 31536000;
$name = "bb" . $name;
$cookiedomain1 = ".forumdomain.com";
$cookiedomain2 = ".sitedomain1.com";
$cookiedomain3 = ".sitedomain2.com";
setcookie($name, $value, $expire, "/", $cookiedomain1);
setcookie($name, $value, $expire, "/", $cookiedomain2);
setcookie($name, $value, $expire, "/", $cookiedomain3);
}
In theory, the code is suppose to set cookies for the three domains lsited, however, this code doesn't seem to want to work because cookies probably can't be set for a third party domain... So, my question is, does anyone have any idea how to make it like a little token ring system so I can bounce the cookies around let it by redirecting the user around to the different sites or any other more intelligient method?