473,657 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpWebRequest / CookieContainer - not deleting cookies.

when I use HttpWebRequest with CookieContainer object that handles cookies,
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, what should be and actually
done with Internet Explorer as client.

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

TIA.


Mar 25 '06 #1
4 5155
Read this article [1] it is very insightful

<%= Clinton Gallagher

[1] http://www.codeproject.com/aspnet/AspNetCookies.asp

"macro" <ma***@discussi ons.microsoft.c om> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
when I use HttpWebRequest with CookieContainer object that handles
cookies,
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, what should be and
actually
done with Internet Explorer as client.

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

TIA.

Mar 27 '06 #2
this article discusses the server side handling of cookies while I'm asking
about a specific issue regarding client side cookie handling.
or maybe I miss your point?


"clintonG" <cs*********@RE MOVETHISTEXTmet romilwaukee.com > wrote in message
news:ug******** ******@TK2MSFTN GP14.phx.gbl...
Read this article [1] it is very insightful

<%= Clinton Gallagher

[1] http://www.codeproject.com/aspnet/AspNetCookies.asp

"macro" <ma***@discussi ons.microsoft.c om> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
when I use HttpWebRequest with CookieContainer object that handles
cookies,
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, what should be and
actually
done with Internet Explorer as client.

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

TIA.


Mar 27 '06 #3
The method of creating the cookie on the server affects the client-side
behaviors particularly where the Expires atttibute does or does not function
as expected. The article also discusses the expiration date you said your
using and has something to say about that approach.

<%= Clinton Gallagher

"macro" <ma***@discussi ons.microsoft.c om> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
this article discusses the server side handling of cookies while I'm
asking about a specific issue regarding client side cookie handling.
or maybe I miss your point?


"clintonG" <cs*********@RE MOVETHISTEXTmet romilwaukee.com > wrote in message
news:ug******** ******@TK2MSFTN GP14.phx.gbl...
Read this article [1] it is very insightful

<%= Clinton Gallagher

[1] http://www.codeproject.com/aspnet/AspNetCookies.asp

"macro" <ma***@discussi ons.microsoft.c om> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
when I use HttpWebRequest with CookieContainer object that handles
cookies,
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, what should be and
actually
done with Internet Explorer as client.

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

TIA.



Mar 27 '06 #4
the problem here is handling standard cookie header responses from servers
that are not in my control. those servers exist out there in the internet
and allowed to treat cookie this way.
the problem is that the cookieContainer that is supplied by the framework
doesn't handle this cookie headers as a standard client suppose to - the way
internet explorer does for example.
i hope i make the problem clearer for you and others that might read this
and can help regarding the problem the cookieContainer doesn't delete
cookies it suppose to delete, and what am I as a dot net programmer should
do about that in order to solve the problem.

"clintonG" <cs*********@RE MOVETHISTEXTmet romilwaukee.com > wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
The method of creating the cookie on the server affects the client-side
behaviors particularly where the Expires atttibute does or does not
function as expected. The article also discusses the expiration date you
said your using and has something to say about that approach.

<%= Clinton Gallagher

"macro" <ma***@discussi ons.microsoft.c om> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
this article discusses the server side handling of cookies while I'm
asking about a specific issue regarding client side cookie handling.
or maybe I miss your point?


"clintonG" <cs*********@RE MOVETHISTEXTmet romilwaukee.com > wrote in
message news:ug******** ******@TK2MSFTN GP14.phx.gbl...
Read this article [1] it is very insightful

<%= Clinton Gallagher

[1] http://www.codeproject.com/aspnet/AspNetCookies.asp

"macro" <ma***@discussi ons.microsoft.c om> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
when I use HttpWebRequest with CookieContainer object that handles
cookies,
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, what should be and
actually
done with Internet Explorer as client.

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

TIA.




Mar 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3501
by: Dan | last post by:
Question about the environment used by HttpWebRequest when making requests: When I use IE to browse a site, all of my cookies, etc. are available as part of the request. However, when I make that same request using HttpWebRequest, all of the cookies that I have are not available as part of the request. Is there a way to change that - I want all of the cookies that the site has set to be available. If there is no way to change it,...
1
5967
by: Michal A. Valasek | last post by:
Hello, I have problem deleting cookies and cookies values (using framework version 1.1 on W2003). When I try to remove entire cookie, by calling Response.Cookies.Remove("Test"), nothing happens, the cookie "Test" remains unchanged. When I try to remove one of cookie values, by calling
0
1185
by: Martin Madreza | last post by:
Hello, hope this question wasn't ask to often... I wrote a C# App with an internet connection over HttpWebRequest. To navigate thru some sites i need a cookie (CookieContainer). Now i want to call a form with a AxWebBrowser displayin the website. i call the navigate methode to load the site but dont know how to set the cookie. I tried the header parameter from the navigate method or
0
989
by: Noel Austin | last post by:
I've run into a problem working with the CookieContainer and was wondering if anyone else has noticed this. The CookieContainer reorders it's cookies. When you send it back to the server using the HttpWebRequest object, the cookies may not be in the same order that they were loaded into the CookieContainer. I was able to verify this with a network sniffer and it's had me scratching my head ever since. Unfortunatly the web site I was...
16
11042
by: Cheung, Jeffrey Jing-Yen | last post by:
I have a windows form application that generates a request, downloads an image, and waits the user to enter in login info. Unfortunately, this image is dynamic and based on session data. I have read documents on the CookieCollection property of HttpWebRequest. Currently, I have the functionality in my code to be able to accept cookies, and return them upon a new HttpWebRequest; however, upon further inspection of the returning...
1
1813
by: john conwell | last post by:
I'm trying to programatically mine newsgroups like yahoo (among others), but need to be able to sign into the site first. my assumption is that when i sign in, a session cookie is created and is used to verify my identity for each http request after that. Does anyone have an example of using the HttpWebRequest with a URL that requires a logon web page first, before accessing the content pages? Thanks
1
2459
by: sameer | last post by:
Hi all, Environment : ASP.NET I am using cookies to store some data. this is done in a class which is called by a web page CookieCreate.aspx. Here is a little bit of code of how i create the cookie in the class Dim context As HttpContext = HttpContext.Current If Not context.Request.Cookies("CartID") Is Nothing Then
5
35276
by: rlueneberg | last post by:
I am totally confused. Can someone please illuminate what is going on under the hood in this piece of code from John Lewis. My main confusion is how the cookieContainer can be passed to the subsequent request if it is not assigned anywhere? So far this is what I understand: -Creates New cookieContainer CookieContainer cookieContainer = new CookieContainer();
2
1329
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Fedora Core 5 Linux. Two questions, if I create a cookie under the "/" path ... setcookie('LoggedIn', 1, time() + REMEMBER_ME_TIME, "/"); 1. How do I check if this cookie is set at the top of a given PHP page?
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.