PHP Beginner, Session cookie Memcache How to use each? Under what circumstances is it generally used? What's the difference? Please help the cows to answer, thank you.
Reply to discussion (solution)
Memcached is a high-performance distributed memory cache server. The general purpose is to reduce the number of database accesses by caching database query results to improve the speed and scalability of dynamic Web applications.
Its characteristics
1. Simple protocol
2. Event handling based on Libevent
3. Internal Memory storage mode
4, memcached not communicate with each other distributed
The role of the session is that it maintains the user's state information on the Web server for access from any page at any time, and the session information is stored on the server
Cookies can keep the login information to the user's next session with the server. Cookie information is stored locally
Sessions and cookies are used to store the visitor's private data, which is stored on the server and stored in the browser
Memcached is used to hold public data (variables and objects) and to exchange data between different program instances
Memcache can be used as a data cache
Http://hi.baidu.com/fdwm_lx/item/e314ebf72e901cdc6225d2d1
To put it a little simpler:
The session is saved in the server.
Cookies are saved in the client.
Session is more secure than cookie.
Cookies do not account for system resources.
Memcache himself to study again.
All you need to know is that the cookie is stored on the client, and the saved data is small, about 4KB.
Session is saved on the server side, the size is basically no limit.
Http://blog.chinaunix.net/uid-20778583-id-301990.html
I am rather dull, this article did not read.
We give analysis and analysis