10 article Recommendations for PHP Setrawcookie () functions

Source: Internet
Author: User
Tags set cookie setcookie
PHP transparently supports HTTP cookies. A cookie is a mechanism for storing data on a remote browser to track and identify users. You can use the Setcookie () or Setrawcookie () function to set the cookie. A cookie is part of the HTTP header, so the Setcookie () function must be called before other information is exported to the browser, similar to the limit on the header () function. You can use the output buffering function to delay the output of the script until all cookies or other HTTP headers are set as needed. Example #1 Setcookie () use example <?php $value = ' something from somewhere '; Set Cookie SE

1. PHP features the use of session mechanism 1--cookie

Summary: PHP transparently supports HTTP cookies. A cookie is a mechanism for storing data on a remote browser to track and identify users. You can use the Setcookie () or Setrawcookie () function to set the cookie.

2. In PHP, the value of the cookie is garbled.

Introduction: PHP in the value of cookies garbled problem $username=mb_convert_encoding ($row 1[0], "GBK", "UTF-8"); Setcookie (' username ', $username); This through the Setcookie on the page will appear garbled but through the Setrawcookie will be error, undefined function errors Consult

3. In PHP, the value of the cookie is garbled.

Introduction: PHP in the value of cookies garbled problem $username=mb_convert_encoding ($row 1[0], "GBK", "UTF-8"); Setcookie (' username ', $username); This through the Setcookie on the page will appear garbled but through the Setrawcookie will be error, undefined function errors Consult

4. The difference between Setcookie and Setrawcookie

Description: The difference between Setcookie and Setrawcookie {code ...} Setrawcookie value plus rawurlencode and no difference

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.