Searched through a few solutions, none of which seem to work for me. Most solutions like this one: HERE seem to point to using:
session_set_cookie_params(0, '/', '.domain.com');
session_start();
I am either not understanding the post or implementing incorrectly. I have the domains below and log in through domain.com
domain.com
sub.domain.com
I've implemented the code above at the top of my login.php life on domain.com
and upon login I set $_SESSION[id] = xyz;
I have session_start();
at the top of my index.php page on sub.domain.com
when I var_dump($_SESSION);
on domain.com i get a value returned.
when I try it on sub.domain.com I get array(0) { }
I've also tried putting the code below at the very top of sub.domain.com but still get nothing.
session_set_cookie_params(0, '/', '.domain.com');
session_start();
So clearly i'm doing something wrong, but I have no idea what. Thanks.