I am trying to set up the following:
auth.example.com
sub1.example.com
sub2.example.com
If the user visits sub1.example.com
or
I have read all answers above, I think my answer is helpful for people googling this:
make sure the browsers send session cookie back to servers (of domain and sub-domains), set session cookie domain as .example.com
.
Make sure PHP find the right "target" to restore the session variable:
session_save_path
is the same for all (I tested)session_set_save_handler
to do that.