BuzzerBeater Forums

BBAPI Support > help with cookies!!!

help with cookies!!!

Set priority
Show messages by
From: FLOG01
This Post:
00
84590.1
Date: 4/6/2009 4:45:02 AM
Overall Posts Rated:
00
Hello everybody!

First, sorry for my english!

Second:

I have a problem with the sending of cookies (C#).

In the first HttpWebRequest I get the cookie, but when I use it for the second HttpWebRequest , the web answered me as if it have not been sent.

This is the source code:

1:
CookieContainer cookieContainer = new CookieContainer();
HttpWebRequest hwrequest = (HttpWebRequest)WebRequest.Create(pUrl);
hwrequest.CookieContainer = cookieContainer;
HttpWebResponse hwresponse = (HttpWebResponse)hwrequest.GetResponse();
...

2:
HttpWebRequest hwrequest2 = (HttpWebRequest)WebRequest.Create(pUrl);
hwrequest2.CookieContainer = cookieContainer;
HttpWebResponse hwresponse2 = (HttpWebResponse)hwrequest2.GetResponse();
...

Thank you very much!
Toni

From: Zavael

This Post:
00
84590.2 in reply to 84590.1
Date: 6/21/2009 1:00:37 PM
Overall Posts Rated:
00
Maybe it logicaly should be:

1:
CookieContainer cookieContainer = new CookieContainer();
HttpWebRequest hwrequest = (HttpWebRequest)WebRequest.Create(pUrl);
HttpWebResponse hwresponse = (HttpWebResponse)hwrequest.GetResponse();
cookieContainer = hwresponse.CookieContainer;
...

2:
HttpWebRequest hwrequest2 = (HttpWebRequest)WebRequest.Create(pUrl);
hwrequest2.CookieContainer = cookieContainer;
HttpWebResponse hwresponse2 = (HttpWebResponse)hwrequest2.GetResponse();
...

but not tested, and not aso good in c# :)

Last edited by Zavael at 6/21/2009 1:01:49 PM