Home  >  Article  >  Backend Development  >  The difference between PHP user login verification cookie and session_PHP tutorial

The difference between PHP user login verification cookie and session_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:43:56952browse

This article will introduce to you the performance comparison between PHP user login verification cookie and session. Students who need to know more can refer to it.


Checked a lot of information. I’ve thought a lot, so I’ll summarize it!


Does PHP's high-performance and high-traffic user login authentication mechanism use cookies or sessions?

1. How does cookie differ from session?

cookie client;

session exists on the server side;

Session security.


2. Sessions have difficulties in being distributed.

Memcache may solve this problem. But if memcache is not used, it will be a big problem to solve.


3. The life cycle of session is not as convenient as cookie.


4. The biggest problem with using cookies is that the server requires secondary verification. If you use session verification, it is better to use session, and the same is true for table lookup.

If the cookie does not require server-side secondary verification, the efficiency will be greatly improved. I guess discuz has this idea.


5. Problems with the combined use of sessions and cookies. This is divided into the above points.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633148.htmlTechArticleThis article will introduce to you the performance comparison between PHP user login verification cookie and session. If you need to know more Students can refer to it. Checked a lot of information. I also thought a lot...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn