Home  >  Article  >  php教程  >  初学:在PHP网站开发中如何使用cookies?

初学:在PHP网站开发中如何使用cookies?

WBOY
WBOYOriginal
2016-06-13 10:29:30881browse

PHP如何使用cookies  ? 


setcookie("cookie_name", $ccdotvalues, time() + (3600*24*30)); 
echo $_COOKIE["cookie_name"];


或者用header输出Set-Cookie也可以创建的.

清除的时候:

setCookie(cookie_name); //或者把cookies过期的日子改到现在
Statement:
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 admin@php.cn