php method to clear cookies in the browser: You can use the setcookie() function to set the cookie expiration time to achieve the purpose of clearing cookies. The setcookie() function is used to send an HTTP cookie to the client.
# The setcookie() function sends an HTTP cookie to the client.
(Recommended tutorial: php graphic tutorial)
The cookie must be assigned before any other output is sent to the client. If successful, the function returns TRUE. Returns FALSE on failure.
Syntax:
setcookie(name,value,expire,path,domain,secure)
Parameters:
php video tutorial)
Implementation code://将过期时间设为一小时前 setcookie("TestCookie", "", time() - 3600);
The above is the detailed content of How to clear cookies in browser in php. For more information, please follow other related articles on the PHP Chinese website!