Is there a way to share session variable across different subdomains? Say, a.domain.com and b.domain.com?
Background story:
So the user goes to www.domain.com, enters his login/password, and then the username is stored in $_SESSION['username'] upon valid login.
After that, the user is redirected to a.domain.com, and on this page the user is again asked for his login/password.
We found out this is due to www.domain.com having different session_id from a.domain.com, thus saving two different session variables.
Is there a way to have $_SESSION['username'] shared on www.domain.com, a.domain.com, b.domain.com, etc?
So far the only way we've found is using cookie to do that. However, we'd like to try to find a session-based solution, if any exists.
Any information/how-to/link would be appreciated -)
Thanks.
Background story:
So the user goes to www.domain.com, enters his login/password, and then the username is stored in $_SESSION['username'] upon valid login.
After that, the user is redirected to a.domain.com, and on this page the user is again asked for his login/password.
We found out this is due to www.domain.com having different session_id from a.domain.com, thus saving two different session variables.
Is there a way to have $_SESSION['username'] shared on www.domain.com, a.domain.com, b.domain.com, etc?
So far the only way we've found is using cookie to do that. However, we'd like to try to find a session-based solution, if any exists.
Any information/how-to/link would be appreciated -)
Thanks.