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

J

Joerg Jooss

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,
 
M

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.
 
J

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,
 
M

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top