1
OK小夥子,所以問題是,我有下面的代碼:Cookie的集裝箱不設置Cookie響應頭部約束
HttpWebRequest req;
HttpWebResponse resp;
// go to the site
req = NetLogHttpWebRequestFactory.Create("http://www.facebook.com/");
resp = (HttpWebResponse)req.GetResponse();
所以resp.CookieContainer
和resp.Cookies
是空的,但resp.Headers["set-cookie"]
包含相應的餅乾:
datr=oMjsTlmv7Z1aIDOEVnIA11tQ; expires=Mon, 16-Dec-2013 16:51:44 GMT; path=/; domain=.facebook.com; httponly,reg_fb_gate=http%3A%2F%2Fwww.facebook.com%2F; path=/; domain=.facebook.com,reg_fb_ref=http%3A%2F%2Fwww.facebook.com%2F; path=/; domain=.facebook.com
如果我認爲resp.CookieContainer
應該包含上面列出的適當cookie,那麼錯了?
謝謝,夥計們!
UPDATE
我也試過問題CookieContainer bug?列出的cookie的容器bug修復代碼,但它也是系統採用CookieContainer
之前不會給出一個有效的結果bwcause它應該叫,但在它的空那一刻。