Question: Differentiate between: (i) Cookies and Session (ii) Client side V/S Server side Programming Languages
0

Subject: Internet Programming

Topic: Server Side Programming: PHP

Difficulty: (i) High (ii) High

ADD COMMENTlink
modified 14 months ago  • written 14 months ago by gravatar for Binita Mayekar Binita Mayekar40
0

Difference between Cookies and Session

Cookie Session
Cookies are stored at client side. Sessions are stored at server side.
Cookies may or may not be individual for every client. Session is independent for every client i.e. individual for every client.
Size of cookie is limited to 4KB and number of cookies to be used is also restricted. There is no limitation on the size or number of sessions to be used in an application.
Cookies can store only “string” datatype. Session can store any type of data because the value for data type is “object”.
Cookie is non-secure since stored in text-format at client side and cookie values are easy to access. Sessions are secured because it is stored in binary format/encrypted form and gets decrypted at server side and also session values are not easy to access.
Cookies not store multiple variables. Sessions can store multiple variables.
Cookie data is available in our browser up to expiration date. Session data is available for the browser run. After closing the browser we lose the session information.
Cookies saves local user data as website specific on local computer on text file. Session is application specific and keeps information until the browser is open.
It contains specific identifier links to server. It contains specific identifier links to user.
Cookie data are easy to modify as they are stored at client side. Session data are not easy to modify as they are stored at server side.

Difference between Client side V/S Server side Programming Languages

Client Side Programming Languages Server Side Programming Languages
Works at the front end and script are visible among the users. Works in the back end which could not be visible at the client end.
Does not need interaction with the server. Requires server interaction.
Examples are HTML, CSS, JavaScript, VB Script etc. Examples are PHP, ASP.net, Ruby on Rails, JSP, ColdFusion, Python, Perl etc.
Response from a client-side script is faster because the scripts are processed on the local computer. Response from a server-side script is slower because the scripts are processed remotely.
Cannot connect to the databases on the web server. It can be connect to the database that is on web server.
Relatively Insecure, because client-side script is visible to the users. Scripts are hidden from view so it is more secure. Users only see the HTML output.
Client side programming can’t access the file system that resides at the web server. Server side programming can access the file system residing at the web server.
It is used when the user’s browser already has all the code and the page is altered on the basis of the users input. It is used to create dynamic pages based a number of conditions when the users browser makes a request to the server.
It makes the page interactive, sorting data in different ways if the user asks for that by clicking on elements with event triggers. It handles logging in, personal information and preferences and provides the specific data which the user wants (and allows new data to be stored).
It is excellent for any case which requires user interaction. It is excellent for any area that requires loading of dynamic data.
ADD COMMENTlink
written 14 months ago by gravatar for Binita Mayekar Binita Mayekar40
Please log in to add an answer.