I am trying to configure the following:
auth.domain.com sub1.domain.com sub2.domain.com
where if a user visits sub1.domain.com or sub2.domain.com and they are not logged in, they go to auth.domain.com and can log in. sub1.domain.com and sub2.domain.com are two separate applications, but use the same credentials.
I tried to install the following in my php.ini:
session.cookie_domain = ".domain.com"
but it does not seem to transfer information from one domain to another.
[change]
I tried the following:
sub1.domain.com/test.php
session_set_cookie_params(0, '/', '.domain.com'); session_start(); print session_id() . "<br>"; $_SESSION['Regsitered'] = 1; echo '<a href="http://auth.domain.com/test.php">Change Sites</a>'
auth.domain.com/test.php
session_set_cookie_params(0, '/', '.domain.com'); session_start(); print session_id() . "<br>"; $_SESSION['Checked'] = 1; print_r($_SESSION);
Session IDs are exactly the same, but when I output the $ _SESSION variable, it does not display both keys, only any key that I set for each domain.
[Change 2]
I updated [Edit]
authentication php session cross-domain
dragonmantank Jun 30 '09 at 15:12 2009-06-30 15:12
source share