i wonder if i’m doing anything wrong or I am just getting this wrong?
I’m loading a part of a of subdomain with jquery load(). just before i’m firing the load method i’m saving a password to a $_SESSION with php. The part of the subdomain i’m loading with jquery load() needs this password information.
Does this count as the same session, because I can’t retrieve the $_SESSION information inside my loaded subdomain part?
Or isn’t this working because I’m actually loading a part of DIFFERENT website so the session is a different one?
any idea?
$_SESSIONis tied to a cookie namedPHPSESSID, which is by default available only to the exact domain name where you use it.a.example.comcan’t access cookies fromb.example.com, and so the sessions can’t cross over, either.There is, however, a way to set the
PHPSESSIDcookie to be available across your entire domain: session_set_cookie_params() allows you to apply relevant settings to thatPHPSESSIDcookie. By setting the domain to.example.com(the dot at the front must be there!), you make the cookie available toexample.comand all subdomains.