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

should i validate cookies values?

hi
should i validate cookies values?

thanks

--
atte,
Hernán Castelo
SGA - UTN - FRBA
Jul 19 '05 #1
4 2102
On Tue, 13 Jul 2004 14:43:52 -0300, "Hernán Castelo"
<hc******@cedi.frba.utn.edu.ar> wrote:
should i validate cookies values?


Absolutely not, otherwise hackers would have a hard time faking them
to break into your site!

In case it's missed, that's sarcasm. Trust but verify.

Jeff
Jul 19 '05 #2
thanks
but
what do you mean
when you say: "trust but verify"?
what is "verify" in this case?

in a newer post
i'm ask if, because the same reason
i need to validate "all " the elements
that i REQUEST at the server side...
(like "Cookies", yes)
and also all the "INPUT" elements
i retrieve with "Request.Form",
being "Text" or "Select" or "Hidden" or whatever
thanks
--
atte,
Hernán Castelo
SGA - UTN - FRBA

"Jeff Cochran" <je*********@zina.com> escribió en el mensaje
news:40****************@msnews.microsoft.com...
On Tue, 13 Jul 2004 14:43:52 -0300, "Hernán Castelo"
<hc******@cedi.frba.utn.edu.ar> wrote:
should i validate cookies values?


Absolutely not, otherwise hackers would have a hard time faking them
to break into your site!

In case it's missed, that's sarcasm. Trust but verify.

Jeff

Jul 19 '05 #3
On Tue, 13 Jul 2004 17:53:57 -0300, "Hernán Castelo"
<hc******@cedi.frba.utn.edu.ar> wrote:
thanks
but
what do you mean
when you say: "trust but verify"?
what is "verify" in this case?
Apologies, possibly a US only term.

This means no matter how much you trust a source as being valid,
always verify what you get from that source.
in a newer post
i'm ask if, because the same reason
i need to validate "all " the elements
that i REQUEST at the server side...
(like "Cookies", yes)
and also all the "INPUT" elements
i retrieve with "Request.Form",
being "Text" or "Select" or "Hidden" or whatever


Anything done on the client can be spoofed or faked at the client end
as well. You can never control the client. So you always need to
control what comes back to the server.

I saw one post that said to verify all the elements you're going to
use, but I'd say you should not request anything you wouldn't use.

Verification means simple things as well as complex. Is it a numeric
filed? Then don't accept non-numeric characters. Have they entered
quotes? Then escape them if you're using them in code. Have they
entered 500 characters for a field that only accepts 24? Trim it to
24 or reject it and make them re-enter it. This last should be
checked on the client *and* the server, the client for entry of more
than the limit for the field, and the server for the same thing, since
you can't guarantee the request they sent actually came from your
form, or was manually entered.

Jeff
Jul 19 '05 #4
wonderful

that is just what i was to know

the validations you are mentioning
are just ones i am going to put

thanks

--
atte,
Hernán Castelo
SGA - UTN - FRBA

"Jeff Cochran" <je*********@zina.com> escribió en el mensaje
news:40**************@msnews.microsoft.com...
On Tue, 13 Jul 2004 17:53:57 -0300, "Hernán Castelo"
<hc******@cedi.frba.utn.edu.ar> wrote:
thanks
but
what do you mean
when you say: "trust but verify"?
what is "verify" in this case?


Apologies, possibly a US only term.

This means no matter how much you trust a source as being valid,
always verify what you get from that source.
in a newer post
i'm ask if, because the same reason
i need to validate "all " the elements
that i REQUEST at the server side...
(like "Cookies", yes)
and also all the "INPUT" elements
i retrieve with "Request.Form",
being "Text" or "Select" or "Hidden" or whatever


Anything done on the client can be spoofed or faked at the client end
as well. You can never control the client. So you always need to
control what comes back to the server.

I saw one post that said to verify all the elements you're going to
use, but I'd say you should not request anything you wouldn't use.

Verification means simple things as well as complex. Is it a numeric
filed? Then don't accept non-numeric characters. Have they entered
quotes? Then escape them if you're using them in code. Have they
entered 500 characters for a field that only accepts 24? Trim it to
24 or reject it and make them re-enter it. This last should be
checked on the client *and* the server, the client for entry of more
than the limit for the field, and the server for the same thing, since
you can't guarantee the request they sent actually came from your
form, or was manually entered.

Jeff

Jul 19 '05 #5

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

Similar topics

0
by: Manjunatha | last post by:
I created an asp page that writes to cookies and copied it to a japanese virtual folder. The cookie writing code is below. first.asp var sUserId = new String(); var sPassword = new String();...
0
by: Vivek Sharma | last post by:
Hi There, I have been trying to get the cookies working. This is my piece of code ..... private bool setCookies(string sUsername, string sPassword) { string sCookiename = "UserInfo";
4
by: mike parr | last post by:
I'm trying to do a check to see if the client browser has cookies enabled. But my code below always gives me the value for acceptsCookies = true, whether the machine has cookies enabled or not. ...
3
by: Alex Nitulescu | last post by:
Sorry, I'm really confused - I'm only at the middle of my book and already I can count 4 methods to store values. Yes, I know that cookies can not store much, but what is the difference between...
1
by: Alex Nitulescu | last post by:
I have the following very simple colde (while learning about cookies and session state): Private Sub cmdAddCookie_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
2
by: William | last post by:
I'm new to ASPX. In my .aspx page I set multiple cookies from the session variables to the "visitor" container: dim cookie as HttpCookie cookie=new HttpCookie("visitor")...
2
by: Nicola Farina | last post by:
Hi all, I'm testing ASP.NET 1.1 authentications and cookies features, and I've red tons of tutorials and articles about this, but not all is clear for me. My goal is to create a basic site...
5
by: Kevin Blount | last post by:
I've setup a method (C#) that I can call, passing it a cookie name, then a name-value pair. The idea is that as I can't append to a cookie, I read the cookie value, append by name=pair to the end...
2
by: Rahul Chatterjee | last post by:
I have a page on my website that sets cookie values and the cookies are subsequently accessed across the rest of the webpages. These cookies are set in the login page and after the user logs in,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.