PHP7中創(chuàng)建COOKIE和銷毀COOKIE的方法
來源:angryTom
發(fā)布時間:2020-05-18 10:45:18
閱讀量:1822
1,如何設(shè)置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() 再設(shè)置值時候原樣輸出
2,銷毀COOKIE
1 | setcookie( "TestCookie" , $value , time()-3600);
|
3,獲取COOKIE值
1 | echo $_COOKIE [ "TestCookie" ];
|