Responding to Cookie Requests

  • Thread starter Thread starter Ian Mooney
  • Start date Start date
I

Ian Mooney

I'm using the HttpWebRequest and HttpWebResponse components to automatically
scrape content from various internet news sites to store on my iPaq PDA
which I later read off-line while commuting to/from work. I don't have room
on the PDA for all the associated advertising stuff these sites have, so I
filter out all but the important text.

It's worked a treat until recently when 1 of the sites I read upgraded.
When I browsed to it using IE, I had to sign-on and accept a cookie from the
server. On subsequent visits to the site using IE, the cookie is read and
the sign-on is bypassed automatically.

Does anyone now how I can automate the reply to the cookie request inside a
dotNet application?

Regards
Ian
 
Hi Ian,

Some webpages are more and more thrash. Microsoft is starting to do things
to prevent that, did you read this article before you do a lot of work.

http://msdn.microsoft.com/security/default.aspx?pull=/library/en-us/dnwxp/html/xpsp2websites.asp

I do not know if your problem is on it (When I understand your problem well,
than is it the dynamic website), and when it is prevented by the servicepack
2 (I doubt it), you do maybe a lot of not needed work.

Otherwise you can maybe just set the security mode in IE in a way that it
does not accept cookies. (Hard today, however maybe the remedy)

I hope this helps?

Cor
 
Ian Mooney said:
I'm using the HttpWebRequest and HttpWebResponse components to automatically
scrape content from various internet news sites to store on my iPaq PDA
which I later read off-line while commuting to/from work. I don't have room
on the PDA for all the associated advertising stuff these sites have, so I
filter out all but the important text.

It's worked a treat until recently when 1 of the sites I read upgraded.
When I browsed to it using IE, I had to sign-on and accept a cookie from the
server. On subsequent visits to the site using IE, the cookie is read and
the sign-on is bypassed automatically.

Does anyone now how I can automate the reply to the cookie request inside a
dotNet application?

Ian,

There isn't actually a "cookie request". Instead, the web client (or
browser) sends on each request the cookies appropriate to the request. This
is determined by the domain and path of the cookie vs. the domain and path
of the request. It is further determined by client privacy settings.

In order to do this in a program, you should look at the
System.Net.CookieContainer class.
 
Hi John,

In order to do this in a program, you should look at the
System.Net.CookieContainer class.

Is this not special made for the serverside so that you to can control the
user cookies when there are more webservers at the same time doing the same
client and not for the clientside to control cookies made by such a server?

Cor
 
Cor Ligthert said:
Hi John,



Is this not special made for the serverside so that you to can control the
user cookies when there are more webservers at the same time doing the same
client and not for the clientside to control cookies made by such a
server?

I've used the CookieContainer client-side as a place to hold cookies sent by
the server and a place for cookies which the client might send back to the
server.
 
Back
Top