Click to See Complete Forum and Search --> : Httpwebresponse - not able to create cookie files


jrs123
May 13th, 2009, 05:51 AM
All,

I am using "HttpWebRequest/HttpWebResponse" object in my Asp.net website (say website1) to communicate with another website (say website2) in a different domain. I am requesting the website2 url from website1 using the HttpWebRequest object and receiving the response from website2 using the GetResponse() method of "HttpWebRequest" object. Also in website2, I am trying to create some cookies to store certain values.

The Problem what I am facing is, while execution, the cookies that I am defined in website2 is not created in the client machine. ie, I am not able to see any cookie file created under the "Cookie" folder on the client machine. But I am able to read the cookie that I am created in the website2 using the "CookieContainer" property.

Also, if I try to access the website2 URL directly in the browser, the cookie file is created on the client machine as I am expected.

But, I want website2 to create the cookie file directly while I am calling it using the "HttpWebRequest/HttpWebResponse" methods from website1.

Is it like, I can not crate a cookie file on the client machine using "HttpWebRequest/HttpWebResponse" methods?

Please help me.