There are 2 cookies PHPSESSID. One on the domain, the second on the subdomain.

On the subdomain, I need to get the value of the cookie that is on the domain.

I am writing $_COOKIE["PHPSESSID"] , everything works. Question: Does $ _COOKIE always give out a cookie? How to indicate explicitly that a domain cookie is needed?

  • Go to the desired page and see what cookies are available from there (developer tools in the browser). - PinkTux
  • I know which ones are available. These 2 are available. They have the same name. It is necessary to obtain from the domain - Radik Kamalov
  • Make a var_dump($_COOKIE) and see what it brings up - Anton Shchyrov
  • I know what leads. PHPSESSID getting. But will domain PHPSESSID always be issued, not a subdomain? - Radik Kamalov

0