Home All Groups Group Topic Archive Search About

HttpWebRequest with CookieContainer - not deleting cookie - what is wrong here?

Author
10 Apr 2006 6:41 PM
macro
when I use HttpWebRequest with CookieContainer object that handles cookies,
i make more than one request and needs to handle cookies being added and
removed between requests, just like a regular web browser like internet
explorer.

if I have this cookie header in a response:

Set-Cookie: <CookieName>=; path=/;expires=01-Jan-1999 00:00:00 GMT

the cookie is not deleted for the next request, and is being sent again with
the old value, while should be deleted - and actually is deleted with
Internet Explorer as client.

is this a bug is there a solution / workaround by manually deleting the
cookie?

please help!

TIA.

Author
10 Apr 2006 6:22 PM
Joerg Jooss
Thus wrote macro,

Show quote
> when I use HttpWebRequest with CookieContainer object that handles
> cookies, i make more than one request and needs to handle cookies
> being added and removed between requests, just like a regular web
> browser like internet explorer.
>
> if I have this cookie header in a response:
>
> Set-Cookie: <CookieName>=; path=/;expires=01-Jan-1999 00:00:00 GMT
>
> the cookie is not deleted for the next request, and is being sent
> again with the old value, while should be deleted - and actually is
> deleted with Internet Explorer as client.
>
> is this a bug is there a solution / workaround by manually deleting
> the cookie?

Another user mentioned this behaviour a couple of weeks ago :-/

Deleting the cookie from the container manually should work.

Cheers,
--
Joerg Jooss
news-re***@joergjooss.de
Author
10 Apr 2006 9:21 PM
macro
thank you

you might just as well say - you need to re-write the framework

or just a little piece of it.

never mind

i just hope it will be fixed some day

or some microsoft engeenier can post some more formal reply than just you
can overcome the bug by writing your own code instead of the framework code.


conclusion - cookie container can only add cookies and does not honor cookie
removal instructions? is it a bug?

thank you.





Show quote
"Joerg Jooss" <news-re***@joergjooss.de> wrote in message
news:94fc507123db08c82af39fdbfd2e@msnews.microsoft.com...
> Thus wrote macro,
>
>> when I use HttpWebRequest with CookieContainer object that handles
>> cookies, i make more than one request and needs to handle cookies
>> being added and removed between requests, just like a regular web
>> browser like internet explorer.
>>
>> if I have this cookie header in a response:
>>
>> Set-Cookie: <CookieName>=; path=/;expires=01-Jan-1999 00:00:00 GMT
>>
>> the cookie is not deleted for the next request, and is being sent
>> again with the old value, while should be deleted - and actually is
>> deleted with Internet Explorer as client.
>>
>> is this a bug is there a solution / workaround by manually deleting
>> the cookie?
>
> Another user mentioned this behaviour a couple of weeks ago :-/
> Deleting the cookie from the container manually should work.
>
> Cheers,
> --
> Joerg Jooss
> news-re***@joergjooss.de
>
>
Author
10 Apr 2006 9:38 PM
macro
BTW

there is no method of the cookiecontainer to remove cookies


Show quote
"macro" <ma***@discussions.microsoft.com> wrote in message
news:%23ClzXxNXGHA.4424@TK2MSFTNGP05.phx.gbl...
> thank you
>
> you might just as well say - you need to re-write the framework
>
> or just a little piece of it.
>
> never mind
>
> i just hope it will be fixed some day
>
> or some microsoft engeenier can post some more formal reply than just you
> can overcome the bug by writing your own code instead of the framework
> code.
>
>
> conclusion - cookie container can only add cookies and does not honor
> cookie removal instructions? is it a bug?
>
> thank you.
>
>
>
>
>
> "Joerg Jooss" <news-re***@joergjooss.de> wrote in message
> news:94fc507123db08c82af39fdbfd2e@msnews.microsoft.com...
>> Thus wrote macro,
>>
>>> when I use HttpWebRequest with CookieContainer object that handles
>>> cookies, i make more than one request and needs to handle cookies
>>> being added and removed between requests, just like a regular web
>>> browser like internet explorer.
>>>
>>> if I have this cookie header in a response:
>>>
>>> Set-Cookie: <CookieName>=; path=/;expires=01-Jan-1999 00:00:00 GMT
>>>
>>> the cookie is not deleted for the next request, and is being sent
>>> again with the old value, while should be deleted - and actually is
>>> deleted with Internet Explorer as client.
>>>
>>> is this a bug is there a solution / workaround by manually deleting
>>> the cookie?
>>
>> Another user mentioned this behaviour a couple of weeks ago :-/
>> Deleting the cookie from the container manually should work.
>>
>> Cheers,
>> --
>> Joerg Jooss
>> news-re***@joergjooss.de
>>
>>
>
>
Author
10 Apr 2006 8:53 PM
Joerg Jooss
Thus wrote macro,

> BTW
>
> there is no method of the cookiecontainer to remove cookies

In case of doubt, create another CookieContainer and copy all cookies you
need :-/

Cheers,
--
Joerg Jooss
news-re***@joergjooss.de

AddThis Social Bookmark Button