cookie

<?php
setcookie("user","姜",time()+60);//设置cookie,并且有时间限制
?>
<?php
setcookie("user","jiangger",time()-3600);//删除cookie
?>
<html>
<body>
</html>
</body>

 

//getcookie

<?php

if(isset($_COOKIE["user"]))
{
echo "welcome" . " ".$_COOKIE["user"] ;
}
else
{
echo " welcome gust";
}
?>

posted on 2017-02-24 18:34  jiangger  阅读(65)  评论(0编辑  收藏  举报