多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 第十三课 cookie和session > cookie 设置cookie,有效期60s,不写长期有效 `setcookie('var','100',time()+60)` 获取cookie `$_COOKIE['']` 删除cookie,time()-1也可以 `setcookie('val','',0)` > session 创建session ``` <pre class="calibre14">``` <span class="token1">session_start</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span> $_SESSION<span class="token2">[</span><span class="token4">'admin'</span><span class="token2">]</span><span class="token">=</span><span class="token3">1</span><span class="token2">;</span> ``` ``` 删除一个 unset($\_SESSION\['admin'\]) 删除多个 $\_SESSION = array(); 销毁 session\_destroy()