Return to site

What are Cookies & Session and What is The Difference Between It

· Android app
broken image

Cookies

Cookies are the messages that web server sends to the web browser while accessing the internet. The web browser stores all the messages in a cookie.txt file. The browser sends the cookies back to the server with each request. These files hold information about your visit to the web page and the details you have added your name etc.

Cookies are used to track websites' activity, when you visit the site, with every visit server gives you a cookie that is used as your verification card. And when you redirect then with each return visit to that site, the browser passes that cookie back to the server. Cookies are used by the online shopping sites to use your details so that you don't need to repeat the process. A professional web development company use the registration details from the cookies.

Cookies are used for security concerns, only the website which creates cookie can read it. So the other servers cannot have access to your information. Web servers can use only information that you chose while visiting the sites.

Webmasters have been used to track websites' access, but cookies can do it easily. Accepting a cookie doesn't provide server access to your computer

Session

The session is a limited time of communication between two systems, and some session includes client & server whether some comprises two PCs.

A session begins when a user accesses particular computer or website and ends when the user closes the web page or shuts down the system. A session can temporarily store information related to user's activity while connected to the system. A session cookie is used in websites' for storing details when the user leaves the web page or close the internet browser.

A common type of session is Web or HTTP session. Each time you visit a website, web browser creates an HTTP Session. While each page visit constitutes an individual session and this term is used to define a duration of each visit.

For example: when you visit e-commerce website and purchase online the entire process is known as a session.

There's another example of a client-server session that is SMTP or email session. Whenever you check your email with Microsoft Outlook etc., it generates an SMTP session that includes sending your account details to the mail server to check new messages and download the messages from the server. After finishing the download, a session is complete.

Instant messaging or personal online chat between to computers is an example of instant messaging sessions.