Home  >  Article  >  Backend Development  >  Beginner: How to use cookies in PHP website development? _PHP Tutorial

Beginner: How to use cookies in PHP website development? _PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:30:01952browse

How does PHP use cookies?


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


Or you can create it by outputting Set-Cookie in the header.

When clearing:

setCookie(cookie_name); //Or change the cookie expiration date to now

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509209.htmlTechArticleHow does PHP use cookies? setcookie("cookie_name",$ccdotvalues,time()+(3600*24*30 )); echo$_COOKIE["cookie_name"]; Or you can create a Set-Cookie using the header output. When clearing:...
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