Session cookie Memcache How to use it separately? What's the difference?

Source: Internet
Author: User
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

  • Related Article

    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.