title: CookieCollection issue when cookie's Path is not set
body: <p>I'm using <code>HttpWebRequest</code> and <code>HttpWebResponse</code> to crawl a site. I'm using the same <code>CookieContainer</code> for each request, ensuring the cookies are handled automatically.</p>
  
  <p>However, one of the requests requires a specific cookie, which is set in a previous response. Although this is present in the collection, its <code>Path</code> property appears incorrect. According to <a href="http://www.ietf.org/rfc/rfc2109.txt" rel="nofollow">RFC2109</a> (Page 7) when a cookie is set with a blank Path (as this one is), the Path should be set to the URL of the request up to but not including the final slash. What's actually happening is that it is being set to the <em>entire</em> URL path, which means that the cookie cannot be subsequently read by a different URL in the same subdomain.</p>
  
  <p>An example:</p>
  
  <ol>
  <li>I request the page at <a href="http://www.myserver.com/sub/mypage.php" rel="nofollow">http://www.myserver.com/sub/mypage.php</a></li>
  <li>The response includes a <code>Set-Cookie</code> header, which reads <em>mycookie=12345;
  expires=Wed, 27-Jun-2012 16:20:00 GMT</em></li>
  <li>The cookie is added to the .NET CookieCollection. As there is no Path set, the Path is
  incorrectly intialised to <em>/sub/mypage.php</em></li>
  <li>I request another page under the same subdomain, but which requires the mycookie cookie, e.g. <a href="http://www.myserver.com/sub/anotherpage.php" rel="nofollow">http://www.myserver.com/sub/anotherpage.php</a></li>
  <li>The cookie is not served by .NET because the Path does not exactly match. If the Path was <em>/sub</em>, it would have been served correctly</li>
  </ol>
  
  <p>I have performed the same navigation steps using the Firefox browser with Firebug and Firecookie extensions. The Path is set correctly, i.e. to the subdomain, in the real browser session.</p>
  
  <p>Can anyone confirm this and possibly point me to a workaround or fix for this issue? Many thanks.</p>