top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a cookie ? What is the difference between session and cookie ?

+1 vote
331 views
What is a cookie ? What is the difference between session and cookie ?
posted Feb 19, 2015 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

A cookie is a bit of information that the Web server sends to the browser. The browser stores the cookies for each Web server in a local file. In a future request, the browser, along with the request, sends all stored cookies for that specific Web server.

The differences between session and a cookie are the following:

The session should work, regardless of the settings on the client browser. The client may have chosen to disable cookies. However, the sessions still work, as the client has no ability to disable them in the server side.

The session and cookies also differ in the amount of information the can store. The HTTP session is capable of storing any Java object, while a cookie can only store String objects.

answer Feb 23, 2015 by Karthick.c
...