0

Is the default domain for a php session cookie always the same as $_SERVER['HTTP_HOST']. Where can I find this information in the php manual? It seems to be $_SERVER['HTTP_HOST'], but I would like verification.

Chris Muench
  • 17,552
  • 67
  • 200
  • 345
  • By default the domain is empty and that information is simply not sent to the client. Consult the HTTP specification and/or your browser documentation to find out what this means for you. – Lightness Races in Orbit Aug 02 '14 at 13:58

1 Answers1

0

the cookie is set by the browser and depends on the domain open on it. It is the same as $_SERVER['HTTP_HOST'] but that doesn't mean that you can change the variable to change the domain of the session cookie.

georoot
  • 3,489
  • 1
  • 28
  • 58
  • I am seeing Set-Cookie:PHPSESSID=28jodee15pbunp7nddgm466sa7; path=/ in the response headers, so I don't think it is set by the browser. I am just interested to know how it picks the domain. – Chris Muench Aug 02 '14 at 23:25