Cookies & Javascript

A lot of mythology exists when the words ‘cookies’ and ‘javascript’ are bandied about in the nontechnical side of the computing world. Most people associate the terms with the internet but that is as far as most people’s knowledge extends. Both cookies and javascript are enormous aids in the use and convenience of the internet and a brief introduction to what’s what is well worthwhile.

Cookies
A cookie is a text file that is included with Hypertext Transfer Protocol (HTTP) requests and responses. Cookies are used to maintain information as you navigate different pages on a Web site or return to a Web site at a later time. This article provides information about cookies.

Important: Cookies cannot be used to run programs or to deliver viruses to your computer.

One of the primary purposes of cookies is convenience, a feature that can save time. The purpose of a cookie is to tell the Web server that you have returned to Web page stored on that server.. For example, if you personalise Web pages, or register for products or services, a cookie helps the Web page server recall your specific information. This may be useful to simplify the process of recording your personal information, such as billing addresses, shipping addresses, and so on. When you visit the same Web site next time, the information previously provided can be easily retrieved, so you can easily use the Web site features previously chosen.

For example: if you previously entered billing or shipping information for a purchase from a Web site, a cookie can automatically retrieve this information and enter it on an order form instead of having to manually enter all this information again.

A cookie can indicate that you previously selected one or more areas of interest you want to see each time you visit a Web site. For example, if you want to view only some types of news, you might select the types of news topics you want to view on a news-related Web site.

You do, however, have the ability to enable or disable cookies, or have Internet Explorer prompt you before accepting cookies in Internet Explorer 4 and later. Note that disabling cookies may prevent some Web services from working correctly - and disabling cookies does not make you anonymous or prevent Web sites from tracking your browsing habits. HTTP requests still include information about where you came from (HTTP Referrer), your IP address, browser version, operating system, and much other information.

Persistent vs. Session Cookies
When you accept a cookie, it is either stored in memory (session cookies) or placed on your hard disk (persistent cookies). Session cookies are those that last for the duration of your online session only and are lost when you come off-line. Persistent cookies, however, are written to the Cookies folder under either your user profile folder or the Windir\Cookies folder. The Temporary Internet Files index is updated with pointers to the actual cookies files.

NOTE: Internet Explorer versions 3.x and 4.x do not distinguish between persistent and session cookies.

First-Party and Third-Party Cookies
First-party cookies are those that are associated with the host domain whilst third-party cookies are cookies from any other domain. For example, suppose that you visit www.example1.com by typing the URL in the address bar, and sample.example1.com, www.example2.com, and www.example1.net have banner ads on this page. If these sites all set cookies, the cookies from www.example1.com and sample.example1.com are in a first-party context, and the cookies from www.example2.com and www.example1.net are in a third-party context.
Cookies are uniquely assigned to your user profile, and can only be read by the host domain that issues the cookie.

Internet Explorer 6 implements advanced cookie filtering based on the Platform for Privacy Preferences (P3P) specification. By default, Internet Explorer 6 blocks third-party cookies that do not have a compact policy (a condensed computer-readable privacy statement) or third-party cookies that have a compact policy which specifies that personally identifiable information is used without your implicit consent. This policy, although providing an additional level of privacy does, in theory, require all forms of cookie rejection to be disabled to get the full advantage of cookies when visiting sites on the internet. Suffice to say, Microsoft have arranged that this privacy issue is not applicable to their own sites!

Java script
Java script is an object based programming language, which where used, is usually embedded in the header of web pages. It can greatly enhance the dynamics and interactive features of a web page by allowing the user or programmer to perform calculations, check forms, write interactive games, add special effects, customise graphics selections, create security passwords and much, much more.

What's the difference between Java Script and Java?
Actually, the two languages have almost nothing in common except for the name. Although Java is technically an interpreted programming language, it is coded in a similar fashion to C++, with separate header and class files, compiled together prior to execution. It is powerful enough to write major applications and insert them in a web page as a special object called an "applet." Java has been generating a lot of excitement because of its unique ability to run the same program on IBM, Mac, and Unix computers. Java script, however, is considered to be much the simpler for the programmer to use than Java and allows real programming to be added to web pages.

It is possible to create small application type processes with javascript, like a calculator or a primitive game of some sort. However, there are more serious uses for javascript:

  • Browser Detection
    Detecting the browser used by a visitor to your page. Depending on the browser, another page specifically designed for that browser can be loaded.
  • Cookies
    Providing routines for storing information on the visitor's computer, then retrieving this information automatically next time the user visits ‘that’ page.
  • Control Browsers
    Opening pages in customised windows, where it is possible to specify if the browser's buttons, menu line, status line or whatever should be present.
  • Validate Forms
    Validating inputs to fields before submitting a form. An example would be validating the entered e-mail address ensure it has an @ in it, since if not, it's not a valid address.

Perhaps you might have reservations about allowing javascript routines to be loaded and run on your computer - but it is our experience that there is little or no problem from javascript routines whilst most of the problems associated with illegal access or malicious meddling are carried out by hackers using Visual Basic. By disabling javascript you will severely restrict or limit the features and content of the majority of web sites.

 


BuiltWithNOF02