Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between session and Cookie

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article to share with you is about the difference between session and cookies, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.

The main differences between cookies and sessions are:

A Cookie, also known as an HTTP cookie, Web cookie or browser cookie, is a small piece of data sent from a website to a server and stored in a user's Web browser. Cookies are used to send information to the website creator about the user's previous activities when the website was last visited. A session is a semi-permanent interactive exchange of information between two communication devices, such as a user computer and a server. This is also known as a conversation, conversation or meeting between two or more devices. A session is basically a communication established at one point and dismantled at another.

Cookies and sessions are two technologies used to process the World Wide Web. Cookies and sessions are used to save certain types of data so that pages load faster and use less bandwidth. Cookies are usually stored on client machines, while sessions are stored on server machines. So they shouldn't be confused for the same thing.

Cookies, also known as HTTP cookies, Web cookies or browser cookies, are small pieces of data sent from a website to a server and stored in a user's Web browser. Cookies are used to send information to the website creator about the user's previous activities when the website was last visited. These cookies refer to actions that allow the website to remember customers during previous visits. When the client visits the website for the second time, cookies are sent from the client browser to the website. Cookies save data, such as clicking on a specific button, logging in, and even a record of which pages were visited by the user months or years ago. Many companies also use cookies for promotional purposes, showing ads of the type that users are searching for.

While cookies cannot carry viruses or any other type of malware, it is easy to track cookies and third-party cookies to check a user's browser history. This is considered illegal by the government. Cookies can also be used to save forms and passwords. Note that when you start typing an email address, it automatically displays options for previously logged in email addresses. If a password is saved, the Cookie automatically saves the password and keeps you logged in to the website. There are various types of cookies: session cookies, persistent cookies, security cookies, HttpOnly cookies, third-party cookies, and zombie cookies.

A session is a semi-permanent interactive exchange of information between two communication devices, such as a user computer and a server. This is also known as a conversation, conversation or meeting between two or more devices. A session is basically a communication established at one point and dismantled at another. During a session, devices send information back and forth. The session is stored on the server, which means that client computers cannot access it. In a session, data is stored on both sides. Client cookies store only the reference number of the data stored on the server.

During a session, when a client logs into a website, the client cookie sends data to the server cookie, which then loads the client-saved data. For example, if a user logs into Taobao's website, create a profile and add it to the shopping cart. When that person logs in again, that profile will be how they were created, and the items added to the cart will still be there. This is how conversations work. Sessions are usually short-lived and can be torn down once the browser is cancelled. For example, if users log into their mail account and randomly leave open pages, they will still log into their account. If they cancel their browser and access mail after a while, they will be automatically logged out. This is because the meeting is over.

Although sessions and cookies are both ways of storing information through web pages, they differ in how information is accessed. Cookies are stored only on client machines, while sessions are stored on both. Cookies are also used to save passwords and form data in browsers so that users do not need to log in. Cookies are also considered less complete than sessions.

The above is what is the difference between session and Cookie, Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report