Differences between session and cookie in php learning

Source: Internet
Author: User
After the summary of session and cookie knowledge, I will explain the main differences between the two to the majority of php learners.

After the summary of session and cookie knowledge, I will explain the main differences between the two to the majority of php learners.
Session stores the customer's status on the server side. as long as the browser is not closed, the user's information can be saved all the time. Generally, the user login information is saved.

The cookie stores the information on the client, which is written to the file.

Session implementation uses the cookie technology (we will introduce it in detail later). first, save a cookie containing the sessionid on the client and store other sessions on the server. When a user requests a service, the sessionid is sent to the server together. You can use sessionid to extract the variables stored on the server to identify users. Of course, if the client disables the cookie, the session will become invalid.

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.