Differences between cookie authentication and session authentication for php users

Source: Internet
Author: User


I checked a lot of information. I also thought a lot. Let's summarize it!

 


Does php use cookies or sessions for high-performance and high-traffic user login authentication?

I. What is the difference between cookie session?

Cookie client;

The session has a server;

Session Security.

 


II. Difficulties in session distribution.

Memcache may solve this problem. However, if memcache is not used, the problem will be solved.

 


3. session is not as convenient as cookie in the life cycle.

 


4. The biggest problem with cookie usage is that the server requires secondary verification. If session verification is used, it is better to use session. The same is true for queries.

If the cookie does not require secondary verification on the server, the efficiency will be greatly improved. It is estimated that discuz is like this.

 


5. Combine session and cookie. This is further divided into the above points.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.