#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    9
    Rep Power
    0

    Cookies Pros/Cons


    Hi all,

    I have a client requirement wherein i have to store SQL statements used frequents by a user against in User Id and display it for him to run it.

    I have two options

    Either to create a table and store these statements against a user id field

    or

    Create cookies and store them in cookies.

    Now the immediate limitation i see in creating cookies is if the user moved to a different machine the cookie is lost.

    the disadvantage in creating a table is obviously additional data object.

    What do you guys suggest ?

    TIA
    Narsi
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    10
    Rep Power
    0
    I'd recommend going with your first option: creating a table and storing a user ID in the user's cookies. As you say, if they moved to another machine or deleted their cookies, they could re-establish their cookie later and have all their queries back. So many web sites work this way that users will most likely expect it. For example, if you put items in your shopping cart at Amazon from your work computer, they show up when you check it from home later that night.

    Also, I'd be nervous about storing SQL queries for a web application on the user's machine. That invites a malicious user to edit the SQL queries and potentially have your application running queries that you didn't expect. You may have safeguards against this, but in general it's a good idea to keep these implementation details behind your site and off the user's machine.

IMN logo majestic logo threadwatch logo seochat tools logo