In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces what are the differences and connections between Session and Cookie, which can be used for reference by interested friends. I hope you can learn a lot after reading this article.
1. Cookie is only generated, managed and used by the client. PHP only issues instructions on how to generate Cookie and when to expire, etc., but the client does not necessarily follow the instructions of PHP.
2. If the Cookie expiration time is not set, Cookie will always exist in the client disk in the form of files or DB such as SQLit.
3. Session is the session between entering a website and closing the browser. The server disk is stored as a file by default, so setting too much Session will affect the disk IO, or you can use the Memory engine to store the MySQL. Because the memory engine reads and writes fast, now you can also specify to use Redis to deal with Session, which is faster and more efficient.
4. The recovery mechanism of Session is passive. If shenzhen.offcn.com sets the life cycle, generally speaking, once you close the browser, Session will be automatically recycled by PHP, but sometimes even if you set the expiration time and close the browser, it will not necessarily delete Session. For example, when you set up multi-directory and multi-level storage of Session, you need to delete Session manually through the PHP script.
5. Cookie is usually bound to Session, that is, when a user does not disable Cookie, Cookie generally saves the sessionID and Session life cycle, and if the user deletes Cookie, he generally exits the system; if Cookie is not disabled, the browser Session will expire immediately, and you need to log in to the system again.
6. Cookie and Session should generally identify users, authenticate rights, store simple data, and use P3P to achieve Cookie cross-domain single sign-on (SSO:Single Sign On).
Thank you for reading this article carefully. I hope the article "what are the differences and connections between Session and Cookie" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.