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

Home Posts Topics Members FAQ

CookieContainer GetCookies fails on multiple Set-Cookies

I am accessing a site that passes the following headers:
Set-Cookie: ASP.NET_Session Id=pwdciy45i0c5 me45urxjfoi0; path=/
Set-Cookie: LastSessID=pwdc iy45i0c5me45urx jfoi0; expires=Tue,
01-Mar-2016 20:07:11 GMT; path=/
Set-Cookie: pubAccID=04; expires=Tue, 01-Mar-2016 20:07:11 GMT; path=/

I have verified this using ieHttpHeaders

When I use asp.net

HttpWebRequest req = (HttpWebRequest )WebRequest.Cre ate(url);
req.AllowAutoRe direct = autoRedirect;
req.MaximumResp onseHeadersLeng th = -1;
req.Timeout = timeout;
req.CookieConta iner = new CookieContainer ();
HttpWebResponse res = (HttpWebRespons e)req.GetRespon se();
res.Cookies = req.CookieConta iner.GetCookies (req.RequestUri );

It only captures "Set-Cookie:
ASP.NET_Session Id=pwdciy45i0c5 me45urxjfoi0; path=/"

Am I doing something wrong? Is there a way for me to get all the
headers.

Thanks

Mar 1 '06 #1
1 4634
can someone tell me if there is a better way to get cookies at least?

guyhey wrote:
I am accessing a site that passes the following headers:
Set-Cookie: ASP.NET_Session Id=pwdciy45i0c5 me45urxjfoi0; path=/
Set-Cookie: LastSessID=pwdc iy45i0c5me45urx jfoi0; expires=Tue,
01-Mar-2016 20:07:11 GMT; path=/
Set-Cookie: pubAccID=04; expires=Tue, 01-Mar-2016 20:07:11 GMT; path=/

I have verified this using ieHttpHeaders

When I use asp.net

HttpWebRequest req = (HttpWebRequest )WebRequest.Cre ate(url);
req.AllowAutoRe direct = autoRedirect;
req.MaximumResp onseHeadersLeng th = -1;
req.Timeout = timeout;
req.CookieConta iner = new CookieContainer ();
HttpWebResponse res = (HttpWebRespons e)req.GetRespon se();
res.Cookies = req.CookieConta iner.GetCookies (req.RequestUri );

It only captures "Set-Cookie:
ASP.NET_Session Id=pwdciy45i0c5 me45urxjfoi0; path=/"

Am I doing something wrong? Is there a way for me to get all the
headers.

Thanks


Mar 7 '06 #2

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

Similar topics

2
2650
by: Joe | last post by:
Hey, I'm going to give some background on my situation in case anyone can point out a way around my problem altogether... for the problem itself, please skip to the bottom of the post. thanks. I've been having some problems with database performance... Several threads are constantly attempting INSERTs of new records into a large table - that is hundreds of thousands of records -large by my account :-) The table has a VARCHAR field...
4
13076
by: John MacIntyre | last post by:
Hi, I have a page with a series of child pages loaded into an iframe. When I move from page to page, I store an object containing the child's control data in a variable on the main page, then use that data to populate the controls when the child page is opened again. One of these objects contains an Array, and the page reloads fine using myArray, myArray, etc... But when I try perform some array methods on it (i.e.slice) ... it does...
0
379
by: DBQueen | last post by:
I am developing an application for a Pathology Lab. There are Batches (BatchID) which contain multiple Samples (SampleID), and there can be multiple tests run from the same Sample, thus there can be multiple records with the same SampleID. The Basic Data for the samples is entered when the batch is set up initially. There are also 3 results textboxes which will hold the results of the Pathology tests. If the user realizes that there is...
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
1
3733
by: VEJIKYUULYCY | last post by:
Hi all, I'm trying to get a .Net client (C# console app) maintain a session with a Java-based web service (Axis), but it doesn't seem to work. (Of course, a Java client to the same service works fine) My C# code looks like this: > TestSvcService ts = new TestSvcService(); > ts.CookieContainer = new CookieContainer();
0
3194
by: kkos | last post by:
I noticed the following issue posted as a double-hop issue in many discussion boards but found no answers that explain how to pass the second hop with windows auth from IIS ASPX page to remote SQL Server. Problem: -------------- I am trying to create an asp.net website with integrated windows authentication to access SQL databases. IIS resides on WinXP and SQL Server on Win2000 SRV. Both are in the same NT Domain. IIS and SQL Server...
8
2016
by: mainframetech | last post by:
We are having a problem with Access 2002 as opposed to Access 2000. A multi-file query was set up under 2000 and tested good. Access is connected through a link to an Oracle 9.1 database. The database (mdb) was installed in remote client machines working with Access2000 and it worked fine. When the query was put on an Access2002 machine, it came up with "ORA-01017 invalid logon/password", and fails. The failing machine passes other...
0
2237
by: greenxiar | last post by:
Very Simple Code: CookieContainer cc = new CookieContainer(); cc.SetCookies(new Uri("http://some.com/"), "a=1; b=2; path=/; domain=some.com;"); cc.SetCookies(new Uri("http://some.com/"), "a=1; b=2; version=1; path=/; domain=some.com;"); First SetCookies pass, but the second failed! My platform is DotnetFramework 2.0/VS2005
6
6841
by: cpptutor2000 | last post by:
Could some C guru please help ? I am writing a Web server on RH 9.0 box. In the section of the code where the Web server has to be initiialized, I have: char host; struct hostent *hp = NULL; .............................. ............................... if(gethostname(host, sizeof(host)) < 0) {
1
3639
by: Constantine AI | last post by:
Hi i am trying to get User input if data does not exist within a DLOOKUP table. I have gotten it to work for one record but not multiple, i have tried to incorporate my code into a loop procedure but i have failed. Could anyone give me any advice? Dim db As Database Dim rst As Recordset Dim rst2 As Recordset Dim strSQL As String Dim Widthval As Integer Dim Depthval As Integer Dim Heightval As Integer Dim...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8603
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...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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
4301
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
1604
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.