PHP determines whether cookies are supported

(*-*)浩
Release: 2023-02-27 12:30:01
Original
2780 people have browsed it

PHP transparently supports HTTP cookies. A cookie is a mechanism that stores data on a remote browser to track and identify users. Cookies can be set using the setcookie() or setrawcookie() functions.

PHP determines whether cookies are supported

Cookie is part of the HTTP header, so the setcookie() function must be called before other information is output to the browser, which is the same as the header() function The restrictions are similar. You can use the output buffer function to delay the output of the script until all cookies or other HTTP headers have been set as required. (Recommended learning: PHP Video Tutorial)

If "C" is included in variables_order, any cookie sent from the client will be automatically included in the $_COOKIE automatic global array. If you want to set multiple values ​​for a cookie variable, you need to add the [] symbol after the cookie name.

According to the setting of register_globals, ordinary PHP variables can be created from cookies. However, relying on this feature is not recommended as this option is usually turned off for security reasons.

Setting new cookie
=============================


Getting Cookie
=============================


Updating Cookie
=============================


Deleting Cookie
==============================
Copy after login

The above is the detailed content of PHP determines whether cookies are supported. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!