What is the difference between JavaScript and the Java programming language?What is a cookie? What are the advantages and disadvantages of using cookies in a web application?

Posted on 2007-08-06
Last Modified: 2013-11-05
What is a cookie and what are the advantages and disadvantages of using cookies in a web application?What is the difference between JavaScript and the Java programming language?
Question by:rafaelmunoz2
    LVL 16

    Assisted Solution

    JavaScript - a scripting language for browsers, and is "run" in the browser.

    Java -  a programming language that is run at the server. Java is equivalent to Visual Basic, C#, and C++, and is an Object Oriented Language. Can be used to write Windows or Web programs.

    A Cookie is a file located on a machine and is used to store state information between the client (browser) and Web Server.  You can write anything you want to a cookie.  Cookies are used to keep track of a users Shopping cart most of the time. Maintaining state without using cookies can be done, but it is more difficult. Most people have cookies enabled these days.
    LVL 10

    Accepted Solution

    --> difference between JavaScript and the Java programming language
    Ans -
    Java is an Object Oriented Programming (OOP) language created by James Gosling of Sun Microsystems. JavaScript was created by the fine people at Netscape. JavaScript is a distant cousin of Java. It is also an OOP language. Many of their programming structures are similar. However, JavaScript contains a much smaller and simpler set of commands than does Java. It is easier for the average weekend warrior to understand.

    JavaScript is an object-oriented scripting language that allows you to create dynamic HTML pages, allowing you to process/validate input data and maintain data, usually within the browser. Originally created by Netscape for use with their Navigator browser, Microsoft reverse engineered the technology, added their own varients and defined JScript. Due to differences, both were more formally turned into the ECMA-262 standard and renamed EcmaScript, though nobody really refers to it by that name

    -->What is a cookie
    A Cookie is a small text file that the browser creates and stores on the hard drive of your machine. Cookie is just one or more pieces of information stored as text strings. A Web server sends you a cookie and the browser stores it. The browser then returns the cookie to the server the next time the page is referenced. The most common use of a cookie is to store information about the user and preferences the user makes. For example, assume you like DVD's and register with Ebay to participate in online auctions. You are required to fill out a form with your name, credit card details and address. Ebay assigns you an ID, stores your information with that ID in its database on the server, and sends the ID to your browser as a cookie. Your browser stores the ID on your hard disk. The next time you go to Ebay, the ID is sent back to the server. The server looks you up by your ID and customizes the Web page it sends back to you. The page might say, "Cheap rates on your favorite DVD's".

    --> What are the advantages and disadvantages of using cookies in a web application?
    Ans --
             1. simple
             2. don't need to send data back to us, browser can participate in this task
             1. size and number of cookies stored are limited.
             2. it stored as plain-text in a specific directory, everyone can view and
                 modify  them. Personal information is exposed.
             3. it won't work if the security level set too high in browser.

    Thanks & Regards


    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now