What is session?
Session is used to identify a user and store the user information. When you first login to a certain web application, an unique session id is created and stored in the web server. For example, if you add an item to your cart on an EC website, this information is also added to the session. In this way, session consists of an unique id and other user-related information. When you visit the same website again, you can open your personal page without entering your name or password. That is because the session id is used to find out who you are.
What is cookie?
Web clients, web browsers in other words, also hold the session ids created in the web sites you have visited. The session ids stored in web browsers are called cookies.
How do they work?
When you visit a website, your browser sends cookie information to the web server as a part of its http request. The web server finds the session id that matches with the cookie sent from your browser. Going through this process, the web server recognizes who is visiting the web site.
Top comments (0)