title: How do cookies work with domains, paths and overriding?
body: <p>I have been reading through <a href="https://stackoverflow.com/questions/1062963/how-do-browser-cookie-domains-work">How do browser cookie domains work?</a> and the RFC at and it answered many of my questions about cookies. Not all of them though (though I'm sure the answer is in the RFC, I haven't been able to properly parse it). I have some more questions, which I will pose in the same format as the above question.</p>
  
  <ul>
  <li>should a cookie for <code>www.example.com</code> be available to <code>www.example.com/path</code>?</li>
  <li>should a cookie for <code>example.com/path</code> be available for <code>www.example.com</code>?</li>
  <li>should <code>www.example.com</code> be able to set a cookie for <code>www.example.com/path</code>?</li>
  <li>should a cookie for <code>www.example.com/path</code> be available to <code>www.example.com</code>?</li>
  <li>should <code>www.example.com/path</code> be able to set a cookie for <code>www.example.com</code>?</li>
  <li>if a cookie is set for <code>www.example.com</code> containing <code>foo=bar</code>, and after that a cookie is set for <code>example.com</code> containing <code>foo=baz</code> should <code>example.com</code> be sent the former, or the latter or both?</li>
  <li>if a cookie is set for <code>www.example.com</code> containing <code>foo=bar</code> that expires in a day, then a cookie containing <code>foo=baz</code> is set that will expire in 15 minutes, should after the latter cookie expires the former cookie be sent?</li>
  </ul>
  
  <p>EDIT One more:</p>
  
  <ul>
  <li>if a cookie is set for <code>www.example.com</code> containing <code>foo=bar</code>, and after that a cookie is set for <code>example.com</code> containing <code>foo=baz</code> what cookie should <code>www.example.com</code> be sent?</li>
  </ul>
  
  <p>Also fixed second case</p>