While trying to access a printer's web interface to automate something I noticed an oddity in the way Powershell handles cookies. What happens is that I send my login info to a server side script, and that script then sets a cookie in the response without a "Path" header.

Powershell then saves that cookie to the path of the login script itself

And will not resend it for any future requests that go to a URI other than "login.cgi", which makes any future actions depending on a login fail.
Now, by http://www.ietf.org/rfc/rfc2109.txt the default value of the path should be: "the path of the request URL that generated the Set-Cookie response, up to, but not including, the right-most /" so in fact the directory the page is in, not the page itself.
I checked the behaviour of IE and Chrome, and that is in fact how they are handling it, they attach that cookie to the path "/" instead of "/login.cgi"

Is this a bug in Powershell or am I doing something wrong? This is in Windows 7 / Powershell 3.0 / .NET 4.5.1
By the way, so far I can work around this problem by manually copying the cookie, but it shouldn't technically be necessary.
$s.Cookies.Add("http://10.0.11.251/", $s.Cookies.GetCookies("http://10.0.11.251/login.cgi"))