473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Strange Cookie Format

2
Hi.

I have been trying to create a cookie container. But the cookie I have stored is not correct.

Below is the code:

request = CType(WebRequest.Create("....."), httpWebRequest)

request.CookieContainer = New CookieContainer()
myCookie = request.CookieContainer ' store the cookie as global variavble
.
.
.
'above request is a GET, after which I needed to POST

Dim request1 As HttpWebRequest
request1 = CType(WebRequest.Create("URL here is obtained from the response of the GET request previously"), HttpWebRequest)
request1.CookieContainer = myCookie
request1.Method = "POST"

GET is successful but POST failed. I have used a program to track my packets and realised that the GET and POST requests are treated together as 1 packet.

In addition, the cookie sent over by the POST request contains

Cookie: $Version=1; Aqu=lt=1190340857; $Path=/; $Version=1; JJ=uuid-4ec51e83-bebd-4c94; $Path=/

This is rather weird as when I use normal IE to access the same website and login, the cookie I sent over will not contain "$Path=/; $Version=1".

In addition, for the POST request the response will be 403 forbidden. I suspect my cookies are wrong.

Can anyone advise on how I can remove "$Path=/; $Version=1" from the cookies?

By the way, does anyone know why GET and POST requests are treated as only 1 packet?

Many thanks.
Sep 21 '07 #1
1 1405
Plater
7,872 Expert 4TB
By the way, does anyone know why GET and POST requests are treated as only 1 packet?
How many do you think they should be?
Packet size is dependant generally on the underlying socket and tcp control of the hardware and communication between endpoints. Having a lot of data in one packet just generally means you have a good connection. (in simple terms at elast, way more to it then that)
Sep 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Geoff May | last post by:
I'm busy rewriting by F1 database and I want to use cookies to store various user definable views, (basically so that when the visitor returns to a specific page, that page will redisplay in the...
13
by: Manlio Perillo | last post by:
Hi. I'm using the Cookie module (on the client side). I have found a problem trying to parse the cookie: "Set-Cookie: value=thevalue; path=/; expires=Fri, 21-May-2004 10:40:51 GMT" The date...
1
by: Tony Archer | last post by:
(Forgive the dupicate post, I had left out the OS Version out of the prior post.) Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a...
2
by: Ian | last post by:
I have a problem I hope someone can point out where I am going wrong. I need to store a date/time in a cookie ( ie the date a visitor last visited ) However the date format changes to US, despite...
7
by: odonel | last post by:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: here is my code: HttpCookie cookie = Request.Cookies;
1
by: adlaird | last post by:
Hi, I created a simple webform, put a test button on it and implemented a click handler that looks like so: private void btnTest_Click(object sender, System.EventArgs e) {...
1
by: Daniel Michaeloff | last post by:
Hi all, I have an application that when finished redirects to a non-ASP.NET app which is choking on a huge ASP.NET session cookie. The cookie "ASP.NET_SessionId" gets transmitted by the browser...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
112
by: Prisoner at War | last post by:
Friends, your opinions and advice, please: I have a very simple JavaScript image-swap which works on my end but when uploaded to my host at http://buildit.sitesell.com/sunnyside.html does not...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.