PHP Study Notes: COOKIE basics, php Study Notes cookie

Source: Internet
Author: User

PHP Study Notes: COOKIE basics, php Study Notes cookie


Why learn from cookies? I can say that I just clicked on a Cookie! Cookies-cookies; small desserts; attractive young women; sweet breads; in the eyes of programmers ....... below is a small amount of Cookie information, PHP code is used to explain how to set the Cookie <? Phpsetcookie ("user", "axl503", time () + 60); echo "Save Cookie";?> This is two ways to get the Cookie value <? Phpecho $ _ COOKIE ["user"]; // directly retrieve the user's Cookie and directly retrieve the user's value, that is, axl503print_r ($ _ COOKIE ); // $ _ when a COOKIE is obtained by a predefined variable (array), all key-value pairs are retrieved as arrays?> /* If you enable or set a comment in Lili, you must add three parameters. The first one is that the user is the key value, user can be customized. I regard user as the second value of ID card as the value corresponding to user, and value as the third time () + XXX of ID card information as the expiration time () +-the expiration time of the ID card * // if the third time parameter is not set, the cookie becomes invalid (in this case, cookie is saved in the browser cache) finally, what I wrote today is how to create a Cookie on the web Cookie is used to store client user information, that is, browser page information. How to run a Cookie between the browser and the server I will explain in detail la la *************************************** ****************************

 

 

 

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.