473,811 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Given the following:

<script>documen t.cookie = "foo=cookie ;";</script>
<form action="form.as px?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 1654
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.QuerySt ring["foo"] returns "query"
Request.Form["foo"] returns "fom"
Request.Cookie["foo"] returns "cookie"
Request.ServerV ariables["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.goo glegroups.com.. .
Given the following:

<script>documen t.cookie = "foo=cookie ;";</script>
<form action="form.as px?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
3165
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 System.Collections.Specialized.NameValueCollection() querystring.Add("login", User) querystring.Add("passwd", Pass) querystring.Add(".persistent", "y")
0
1500
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 then i need to create an admin cookie if ACCESS =user then i need to create a user cookie. The page is redirected to an aspx page where it reads the cookie. if the cookie is admin then access to the entire site should be possible otherwise access...
13
1748
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 using hidden form fields. Just curious! Want to know how to "simply" maintain user form inputs across a web site even when security and privacy controls are set to MAXIMUM on the browser. I know using databases would do it, but I would love to...
0
333
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: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchaspnetcookies101.asp under section: 'Checking Whether a Browser Accepts Cookies' This code works great, when its in my development enviroment.
6
3063
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 cookie (say Response.Cookies ("TEST")) and you have a query string variable &test=x or &Test=x and you get Request.QueryString to parse the query string, the cookie that gets dropped matches the case of the query string, not what your code says. ...
1
4890
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 or so ago everything was working fine. I honestly can't remember changing anything since it was last working. But I tried reinstalling the .Net Framework along w/ the service pack, which didn't work. I also had v1.1 already installed but I hadn't...
11
15898
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 session xfer to work, possibly due to the cookies not being compatible. I've spent over a week trying to get the HWR to integrate nicely with my app, but I cannot get the session to transfer, and it'd probably take me even longer if I tried to digest...
6
6449
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 pages: Cookies or Session variable or by the HTTP header (either GET querystring or POST form)? I do not like to use sessions because they time out after 20 minutes of inactivity.
6
1523
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 cookies are created, the browser doesn't render the page anymore. The threshold i found (with trial and error) is this: 48 times 5 cookies. If i put 49 instead of 48, the page is not rendered (error= "the page cannot be rendered"), otherwise,...
0
10389
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
10135
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
9205
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...
1
7670
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
6890
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
5554
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
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
3
3018
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.