CLIENT AND SERVER SIDE PROCESSING OF DATA
You are now familiar with the fact that internet presents a two-way communication model, also called the
Client-Server Model as shown in Fig. 1 below. In the client server model some data is processed on the
client side and certain data is processed by the server on the server side.
Client side processing
cookies (in most cases). As a matter of fact, the browser installed on the client side has the capability to
side for simple calculations and for pattern checking. We have already learnt this concept in the examples of
programs. Applet code is sent from server to the browser for processing. Examples of applets include
animation files, java games spreadsheets etc. Typically applets take more space on the window screen Applet
call example Consider the following HTML document where a special <applet> tag has been used to make
a call for the applet code. The URL of the site where applet code is stored has been assigned as a value for
the code attribute. Width and height attributes are used to specify the space allocation for the display of the
<APPLET CODE=http://www.xyz.com/carfind.class width=100 height=200>DEMO</APPLET>
Cookies are text files stored on client's hard disk sent by the server side due to cookie related
document.write("Currently, your cookie is "+document.cookie); //--> </SCRIPT> <FORM
This information would be treated as a Cookie: <INPUT TYPE="TEXT"
<INPUT TYPE="Button" name="setCookie" VALUE="Set Cookie!"
In the above code, a text box called cookie is created. When a user clicks the button Set Cookie, the control
is shifted to the function update Cookie which creates a cookie in the hard disk of the client and opens or
reloads a fresh page for the user with the information of the current cookie written on it. Suppose that I
type the word Ahmad in the text box and click the button Set Cookie, then the cookie `Ahmad' would be
consequently created and stored in the hard disk. See figures 2-4 below.
Cookies can be used to track customers online. Typically, a unique ID of the customer is stored in the
cookie file on the hard disk. Same ID is also stored in the database along with the record of previously
purchased items by the customer. When the customer again visits the online store, cookie (having customer
ID prepared against that URL) is transmitted by the browser to the server side. There, it is matched with the
ID in the database. This enables the merchant side to know that a particular customer (with a known buying
pattern) has come to visit again. By tracking the customer in this manner, personalized recommendations
for certain items can be made to the customer in real time.
Cookies can also be used to maintain state between two broken sessions. Thus, it is possible that some
information of the previous session is stored in the cookie file, and this information is available (through
cookie) to the server side on starting a subsequent session. For instance, in the code of a web form certain
information received form the user can be stored in the variables as shown below:
The coder can also define a variable to set the expiration date of the cookie as follows:
expirationDate="Friday, 01-Dec-11 12:00:00 GMT"
Then using cookie property of the document object all such information can be stored on the client hard
disk in a cookie file and can be used for maintaining state between two sessions:
Fat vs. Thin Client
Fat clients have a lot of processing done on the client side. On the other hand, thin clients have very little
processing on client side, and most of the processing takes place on the server side.
Table of Contents: