473,396 Members | 1,935 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,396 software developers and data experts.

HttpRequest[] : priority of cookies, form, querystring collections.

Given the following:

<script>document.cookie = "foo=cookie;";</script>
<form action="form.aspx?foo=query" method="post">
<input name="foo" type="hidden" value="fom" />
<input type="submit" />
</form>

What is the value of Request["foo"] server side? Experiment shows that
GET overwrites POST which overwrites the cookie. Is this documented
somwhere?

Ken Prat

Nov 19 '05 #1
1 1639
the cookie is sent in a header field and has nothing to do with method, as
it always appears before any post data. the query string data is alo
seperate from the form post data.

so:

Request.QueryString["foo"] returns "query"
Request.Form["foo"] returns "fom"
Request.Cookie["foo"] returns "cookie"
Request.ServerVariables["foo"] returns null

Request["foo"] returns the first value found in the
above order

counting on this order is bad coding.

-- bruce (sqlwork.com)
<ke******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Given the following:

<script>document.cookie = "foo=cookie;";</script>
<form action="form.aspx?foo=query" method="post">
<input name="foo" type="hidden" value="fom" />
<input type="submit" />
</form>

What is the value of Request["foo"] server side? Experiment shows that
GET overwrites POST which overwrites the cookie. Is this documented
somwhere?

Ken Prat

Nov 19 '05 #2

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

Similar topics

0
by: HaAwK | last post by:
here is the code, basically: ---------------------- Dim HTMLString As String Dim WebClient As New System.Net.WebClient() Dim querystring As New...
0
by: collie | last post by:
i need to create 2 separate cookies in asp to be read later on in asp.net. I need to create an ADMIN cookie and a User cookie. In my database i have a table called users. if the field ACCESS=admin...
13
by: G | last post by:
Hello, Is it possible to send form values from PAGE1 to PAGE2, and then retain the form info for PAGE3 without using cookies, sessions or DB storage? Also, I dont want to repost page2 to page3...
0
by: Lucifer | last post by:
Hi I have some code for checking for cookies, that sets a cookie on page1 and checks for it on page2. and its based on the code by MS: ...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
1
by: Mark Miller | last post by:
I just recently started getting the above error on a page I am posting MULTIPART/FORM-DATA. We have SoftArtisans FileUp component and Filter installed on the server in question and up until a day...
11
by: Keith Patrick | last post by:
Could someone explain to me the relationship between these two classes? I am ripping my hair out trying to divert an HttpRequest to a new location via an HttpWebRequest, but I cannot get my...
6
by: Paul | last post by:
Here is a question that should get everyone going. I have an ecommerce site where I need to pass the order_id to every page. So which method is the best practice to pass this variable between...
6
by: André | last post by:
Hi, Not sure it's a asp.net problem, but i discovered it with asp.net, so ... I need to pass data from page to another, so i use cookies for that. My problem is that when a certain amount of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.