what is a cookie? and how it is useful in scripting languages?

i need to know what extacly are cookies? and in javascript file untill you dont delete cookies, you wont get any changes reflected on screen.why?

Replies

  • Ankita Katdare
    Ankita Katdare
    Cookies are files which are stored on a user's computer that hold data specific to a particular client and website, and can be accessed either by the web server or the client computer.

    Each cookie is a small lookup table containing pairs of (key, data) values - for example (firstname, abc) (lastname, xyz).
    Once the cookie has been read by the code on the server or client computer, the data can be retrieved and used to customise the web page appropriately.

    Cookies are maintained by 'your' web browser, so the method of deleting them will vary depending on which browser you are using.

    For eg:
    Firefox 3.0
 :
    Select the 'Tools->Clear Recent History' menu item. Choose the time range you wish to clear, then check the 'Cookies' option, check/uncheck other options as required and click 'Clear Now'.

    Google Chrome 5.0 :
    
Choose 'Options' on the 'Cutomsize and control' menu, then open the 'Under the Bonnet' tab. In the 'Privacy' section, click on the 'Clear browsing data...' button then check the 'Delete cookies and other site data' option and check/uncheck other options as required. Choose the time period you wish to clear and click 'Clear browsing data'.

    PS: If you delete all the cookies on your computer, some websites may require you to re-enter the information which was previously stored in their cookies.
  • Morningdot Hablu
    Morningdot Hablu
    hm data and key both comes at once it means it is used for authentication purpose.
    I think data and keys stored in hashtable which provide direct accessing(faster equation).
    Am i write AKD.....?
  • Ankita Katdare
    Ankita Katdare
    @Mohit: Yeah that's right.

    kunaljd
    in javascript file untill you dont delete cookies, you wont get any changes reflected on screen.why?
    I didn't get the question. Someone please answer.
  • kunaljd
    kunaljd
    thing is, i am changing the code but browser was not showing the changes done. i search for it but didnt found any answer then someone told me to delete cookies .and now, browser is showing the changes. this was the scenario.

    abrakadabra:= u got the question??😕😕😕
  • Manish Goyal
    Manish Goyal
    what changes???
  • kunaljd
    kunaljd
    its related to mapping the data to proper end. and syantax is {code:'hello', url:"abc.jsp", target:"_self"}.
  • Radhika Deshpande
    Radhika Deshpande
    This may be because some web -sites does not support third party cookies.

    This is what i found when it comes to third party cookies that you are saying-
    #-Link-Snipped-#

    May be not answer to your question but might be useful in other reference.
  • Deepika Bansal
    Deepika Bansal
    AKD you said that cookies are maintained by our web browsers. So when we save our username and password for some sites then is this work also done by cookies.??
    And if not, please tell me in what context cookies are used.(Talking from web development point of view)
  • Sachin Jain
    Sachin Jain
    Guys, I want to add something.
    Lets start from very Basic why do we need cookies and what is it. ?

    First of all, HTTP is stateless protocol That means it does not save any kind of information about the users.
    Normally the websites do not store any information about any user.
    But some websites do need to store some information that user is using.
    For example :-
    You are buying a book from Amazon website.
    simultaneously some other user might also be buying some book.
    So to distinguish the different users and store the information what books they are buying,websites use cookies.
    Lets see how it works
    Actually when we use such websites, they store some integer value in our system.
    (Through HTTP response. Actually HTTP packet format also contains a field name cookie-no.)
    So when some cookie no is set by the website and sent to our browser.
    Our browser saves this the cookie no and the website name in some file (which we say cookie file)
    Now, the webserver makes a database (Lookup Table) using cookie no (integer) and corresponding to it some records like which book we have added to our cart.
    So next time you visit the website again, your browser adds the integer value from cookie file and sends the request to the server.
    Now the server comes to know which user is coming to it.
    Now the server can welcome you if your user name was saved or something else.

    For example :-
    Just visit the YOUtube and serach for cricket videos for about 5-10 minutes.And Download 1-2 of them.
    Now after 20 minutes visit again youtube, youtube will show you "RECOMMENDED FOR YOU"

    You can observe this in many websites.This is done using cookies.
    I Hope cookie is clear now.
    I have not used javascript so i don't know about your question.Sorry 😔
    Hey guys please correct me if i am wrong somewhere.

You are reading an archived discussion.

Related Posts

Hi, i'm new to Matlab. i have this code that extract image feature using gui. i have problem creating a code that can record data extracted into csv and txt...
This is the official promotion video of the new Toshiba Libretto W100 7-inch dual-screen netbook. [video=youtube;DycgQSISt_U]https://www.youtube.com/watch?v=DycgQSISt_U[/video] Share your views and opinions about this.
Philips' Master LED bulbs i.e. the company's new bulbs, dubbed EnduraLED, are four times as bright. Due in the fourth quarter of the year, the 60W equivalent at left sucks...
[FONT="]Condensate Polishers at Power Plant[/FONT] “This article is talking about the functions of Condensate Polishers at Power Plants , and Their Types according to their Functionality , .. “ Condensate...
i was in my friends village bfore a few days n i noticed that there is a serious problem wid the farmers i.e they wake up at night every now...