Session Management The difference between -0.2.session and cookies

Source: Internet
Author: User

The biggest difference between a session and a cookie is:

1. Save in different locations

The session is stored in the server's memory, and the cookie is stored in the browser or client file;

2. Different life cycle

Session is an access-based process that records the start-to-finish of an access, when the browser or process is closed, the session "disappears", and the cookie is used more to identify the user, it can be long-term for users to track and identify unique users (unique Visitor).

3. Different security

Cookies are not very secure, and others can analyze cookies stored locally and make cookie spoofing, taking into account that security should use the session.

4. Different consumption resources

Session will be stored on the server for a certain amount of time, and when the access is increased, it will occupy the performance of your server. The cookie should be used in consideration of mitigating server performance .

5. Different size limit

the limit for a single cookie on the client is 3K, which means that a site cannot store more than 3 K of cookies on the client .

In short, if the cookie mechanism is to check the customer's "pass" to determine the customer identity, then the session mechanism is to check the server on the "Customer schedule" to confirm the customer identity.



From for notes (Wiz)



Session Management The difference between -0.2.session and cookies

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.