PHP7中创建COOKIE和销毁COOKIE的方法
来源:angryTom
发布时间:2020-05-18 10:45:18
阅读量:1568
![](https://img.php.cn/upload/article/000/000/040/5e36cfa28cdcc994.jpg)
1,如何设置COOKIE
1 | setcookie ( string $name [, string $value = "" [, int $expire = 0 [, string $path = "" [, string $domain = "96net.com.cn" [, bool $secure = false [, bool $httponly = false ]]]]]] ) : bool
|
setrawcookie() 再设置值时候原样输出
2,销毁COOKIE
1 | setcookie( "TestCookie" , $value , time()-3600);
|
3,获取COOKIE值
1 | echo $_COOKIE [ "TestCookie" ];
|