Home >Backend Development >PHP Tutorial >The difference between PHP user login verification cookie and session_PHP tutorial
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.