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