Blogger Information
Blog 15
fans 0
comment 1
visits 10921
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
会话技术 cooki与session--4.20日
吴明的博客
Original
612 people have browsed it

总结:cookie 是session 的基础,但不同的cookie存储于客户端的浏览器上,session存储于服务器中。

  1. 设置cooki(name,value,expire)  setcookie(name,value,time());$_COOKIE['name']

  2. session与cookie非常像,只是把用户数据保存到了服务器上,session使用之前必须开启session_start(),

    超全局变量session直接通过数组设置的,即$_SESSION["value"] = ** 来设置的,删除所有的session 值 直接赋值为空,完整的删除包括三步:

    ①$_SESSION = [];  //清空当前用户的所有会话信息

    ②session_destroy(); //清空当前域名下所有的会话信息

    ③setcookie('PHPSESSID', '', time()-3600); //删除保存在客户端上的会话id

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post