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 Cookies and Session

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

What is the difference between Cookies and Session? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

1.session is a session: when a user opens a web application, a session is generated with the web server. The server uses session to temporarily save the user's information on the server, and the session will be destroyed after the user leaves the site. This method of storing user information is more secure than cookie, but session has a drawback: if the web server does load balancing, the session will be lost when the next operation is requested to another server.

2.cookie is the data stored in the local terminal. Cookie is generated by the server and sent to the browser. The browser saves the cookie as kv to a text file in a directory, and the next time the same website is requested, the cookie will be sent to the server. Eg. Log in to the website, enter the user name and password to log in today, and then open it in many cases the next day. One of the mechanisms used at this time is cookie.

3. What cookie and session have in common is that both cookie and session are session methods used to track the identity of browser users.

4. So: store login information and other important information as SESSION; and other information. If you need to keep it, you can put it in COOKIE.

After reading the above, have you mastered the difference between Cookies and Session? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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

Internet Technology

Wechat

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

12
Report