title: PHP setcookie domain parameter
body: <p>I'd like to understand how does <em>domain</em> parameter of <code>setcookie</code> function works. I've the following code:</p>
  
  <p>setcookie.php:</p>
  
  <pre><code>setcookie("cookie_4", "c4", time()+3600, "", "home_domain.com");
  setcookie("cookie_5", "c5", time()+3600, "", "sub2.home_domain.com");
  </code></pre>
  
  <p>When i make the request form <code>http:\\home_domain.com\setcookie.php</code>
  the <strong><em>cookie_4</em></strong> is available in both <code>http:\\home_domain.com\getcookie.php</code> and <code>http:\\sub2.home_domain.com\getcookie.php</code> requests but cookie <strong><em>cookie_5</em></strong> isn't available from <code>http:\\sub2.home_domain.com\getcookie.php</code> even if it's explicitly set  for domain <strong><em>sub2.home_domain.com</em></strong>?</p>