Delete a cookie when a cookie is created, its cookie file is automatically deleted when the browser is closed if it is not set to a valid time. If you want to delete the cookie file saved in the client before closing the browser, there are two ways
Setcookie () defines a cookie that is sent along with the rest of the HTTP headers. Like other headers, a cookie must be sent before any other output from the script (this is a protocol restriction). This requires that the call to this function be
The cookie is like a session in PHP, just one on the client is on the server side, let me describe in detail PHP Setcookie to the cookie set and delete code.
Setcookie () syntax
Setcookie (PHP 3, PHP 4, PHP 5)
Setcookie--Send a cookie
Setcookie () defines a cookie that is sent along with the rest of the HTTP headers. As with other headers, cookies must be sent before any other output of the script (this is the protocol limit). This requires that the call to this function be
Setcookie () defines a cookie that is sent along with the rest of the HTTP headers. As with other headers, cookies must be sent before any other output of the script (this is the protocol limit). This requires that the call to this function be
You can use php setcookie to set or delete a cookie in php. If you set the cookie, you can set a value. If you delete the cookie, you can delete it if it is null or if it expires, here are some examples.
For a long time, when deleting cookies in
For a long time, when deleting cookies in phpBool setcookie (string $ name [, string $ value [, int $ expire = 0 [, string $ path [, string$ Domain [, bool $ secure = false [, bool $ httponly = false])$ Value can be written at will, and $ expire can
The hp function setcookie () reports the following error: Warning: Cannotmodifyheader. Today, when using the php function setcookie () to set the value, the following error occurs: Warning: Cannotmodifyheaderinformationheadersalreadysentby. go to gg
A cookie is like a session in php, but one on the client is on the server. Next I will introduce in detail the setcookie setting and deletion code in php.
Setcookie () syntax
Setcookie (PHP 3, PHP 4, PHP 5)
Setcookie -- send a cookie
Note: bool
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.