PHP Session control (learn about the difference between a cookie and a session)

Source: Internet
Author: User
Tags php session

Same point :

Can solve the problem of HTTP stateless, so that the same client in the site to access multiple requests, you can save, set up information, and the request to establish a connection between things.

different points :

Simply say that the cookie information is saved on the client, and the session information is saved on the server side.

Session using key-value pairs, that is, the ID of the client, and the value placed on the server side, the user's ID to find the corresponding value on the server, this way value placed on the server side, there is a time limit, time to the server automatically recycle/release.

Cookies have two methods, one is to save the value in the browser variable, when the browser closes, the other way is saved on the hard disk, as long as the time is not enough, the next time can be used.

Contact :

When a client uses a cookie-based SessionID, SessionID is generally stored in a cookie.

Remark :

Cookies are shared between browsers of the same kernel, and different kernel browsers are not shared, such as Firefox and IE (where storage locations are different and of course not shared). Different kernel browsers cannot share cookies and can also produce different sessionid.

PHP Session control (learn about the difference between a cookie and a session)

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.