I read a lot of forums (including this one) about passing session variables between subdomains, and I can't get this to work. Can someone explain what I'm missing?
Step 1 In the php.ini file: session.cookie_domain = ".mydomain.com" Checked with phpinfo () that I am using the correct php.ini file
Step 2 On the page www.mydomain.com set the session variable $ _SESSION ['a'], make sure that it is displayed by calling it on the next page (it does). Clink Link to sub.mydomain.com
Step 3 The page at sub.mydomain.com checks to see if the session variable is set using:
$ a = $ _SESSION ['a']; if (! Iset ($ _ SESSION ['a'])) {echo "Error: session variable unavailable"; }
Sorry, I am getting an error. What am I missing? Thanks in advance for your help.
php subdomain session
Ian May 14, '10 at 15:45 2010-05-14 15:45
source share