A
andrewsc
Hi,
I'm writing a client-side Web console application, which needs to
navigate from page to page. When I access the first page, the server
sends me some cookies, which I need to return in the second request,
etc. Unless the cookies apply to a different domain.
In client-side code, what is the best way of returning cookies to the
server ?
I'm looking at the CookieContainer property of HttpWebRequest. The
documentation does not specify whether the request object is able to
filter for the cookies which apply to the URI. Would be nice to have
a single CookieContainer object, with each request picking up its own
cookies. After all, the request known the URI, so it should be able
to pick up the relevant subset.
The documentation only says about the CookieContainer property: "Gets
or sets the cookies associated with the request". It does not say
whether the request actually sends any, all, or none of the cookies
in the container. Any ideas ?
I have seen explicit filtering done in
http://www.dotnetboards.com/viewtopic.php?t=7453&view=next
I hoped it wasn't necessary for my own code to filter cookies by their
URI. On the other hand, it could be worse, if I had to add the
"Cookie" headers myself to the request.
Andrew
I'm writing a client-side Web console application, which needs to
navigate from page to page. When I access the first page, the server
sends me some cookies, which I need to return in the second request,
etc. Unless the cookies apply to a different domain.
In client-side code, what is the best way of returning cookies to the
server ?
I'm looking at the CookieContainer property of HttpWebRequest. The
documentation does not specify whether the request object is able to
filter for the cookies which apply to the URI. Would be nice to have
a single CookieContainer object, with each request picking up its own
cookies. After all, the request known the URI, so it should be able
to pick up the relevant subset.
The documentation only says about the CookieContainer property: "Gets
or sets the cookies associated with the request". It does not say
whether the request actually sends any, all, or none of the cookies
in the container. Any ideas ?
I have seen explicit filtering done in
http://www.dotnetboards.com/viewtopic.php?t=7453&view=next
I hoped it wasn't necessary for my own code to filter cookies by their
URI. On the other hand, it could be worse, if I had to add the
"Cookie" headers myself to the request.
Andrew