Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

doubt : abt Cookies

  Asked By: David    Date: Feb 01    Category: Java    Views: 592
  

We r building a jsp project.
We r keeping around 8 kb data with in 3 cookies ,for client side validation, as
a user logins.
Hope this will reduce the server to client traffic and server side over head for
reading the 8kb
data from database.
But my doubt is, as I have written the 'cookies methods and comparisions' in
server side
scriptlets,
those cookies will be taken to server for the execution of these scriptlets ?
If so that will increase server-Client traffic

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Lurlene Fischer     Answered On: Feb 01

Why not use Java Script for Client Side Validation ?

 
Answer #2    Answered By: Helene Stewart     Answered On: Feb 01

I m using js itself.
But the same data  is used for client  side validation  in more than one pages,
So we have an idea, to keep them in cookies...............
(eg. In our webpage there is text box for inputing age
we have to validate the age at the client side  using js
as it is less than 20.
This data '20', we r taking from server  database and keeping in client side as
cookies.....
So here my doubt  starts which i asked u at previous mail
waiting 4 rply.

 
Answer #3    Answered By: Feodora Bonkob     Answered On: Feb 01

I believe you are correct that this will cause the cookies  to go back to the
server - probably every time the user  submits one of your pages. For those of
your users on asymmetric links, this will be a slower connection direction than
receiving data  from the server  too.

Worse though - much worse - is that you've got a security hole or two. Firstly,
anything verified at the client  end can be spoofed at the client end relatively
easily. The validation  is not secure at all. Secondly, what is in this 8k?
Presumably information about other users. Cookies are text items which can be
read on the client without much trouble.

Do your validation on the server.

Next question is why you would need to read 8k of data from a database  to
validate a user. Have a look at your design and see if you can cut this down
(probably way down). But also remember that your server will get this
information on a fast disk path, so the overhead of 8k would not be too great
anyway.

 
Answer #4    Answered By: Della Simpson     Answered On: Feb 01

Thi project  is for share brokers,
We r keeping verious settlement no in database(Settlement no is unique for
transactions in terms of Accounts)
We have to validate user  enterd settlement no at client  side, and we dont want
to send wrong settlement no to server  and validare at server.

 
Answer #5    Answered By: Devrim Yilmaz     Answered On: Feb 01

Why do you think that the server  will be loaded if you kept the
persistent data  (8kb) in the DB? It is always a good practice large
amount of context sensitive data in the DB.

 
Didn't find what you were looking for? Find more on doubt : abt Cookies Or get search suggestion and latest updates.




Tagged: