Difference between Cookies vs http session

What is the Difference between Cookies vs http session?

Difference between Cookies vs Http session

Difference between Cookies vs Http session: Before differentiate between these two we should first know about these two parts one by one. Then we should discuss the Cookies vs Http session.

What is Cookies?

Cookies are text files stored on the client computer and they are kept of use tracking purpose. Server script sends a set of cookies to the browser. For example name, age, or identification number etc. The browser stores this information on a local machine for future use.

When next time browser sends any request to web server then it sends those cookies information to the server and server uses that information to identify the user.

15 Most asked questions in viva or interview from JAVA

What is Https Session?

A session creates a file in a temporary directory on the server where registered session variables and their values are stored. This data will be available to all pages on the site during that visit.

A session ends when the user closes the browser or after leaving the site, the server will terminate the session after a predetermined period of time, commonly 30 minutes duration.

What is the Difference between Cookies vs Http session?
NumberCookieshttp session
1Cookies are data on client side.http session Data on server-side.
2It has limited support for data handling
It has unlimited side of data as per as server capability
3For Cookies age of data is fixed. For http session age of data is not fixed.
4It can store only text.It can store any type of data.
5It remains on client machine.It destroy after session timeout or logout.
6All cookie need to travel each time client sends request to server.It has less data traveling over the network
7It is less secure.It has more secure mechanism to session tracking

Leave a Reply

Your email address will not be published. Required fields are marked *