cookie and session
2012-08-10 17:38
239 查看
1.COOKIE AND SESSION
COOKIE was saved in client;
session was saved in server;
2.cookie configuration
Setcookie(string name,string value ,int expire,string path,string domain,int secure);
expire:limited time;
eg.SetCookie("MyCookie","fwefwefwe",time()+3600,"/forum","evocacs.php100.com")
recieve cookie
$_COOKIE["MyCookie"];
delete cookie
SetCookie("Cookie","");
pay attention1: if you set cookie ,you should befor HTML DOC
2.Session
session_start();
$_SESSION[name]=value;
isset($_SESSION[name]);
unset($_SESSION[name]);
session_destroy();
3.cookie
if you set the cookie and you need to refresh the page :
code : <javascritp> location.href="local.php" <javascript>
COOKIE was saved in client;
session was saved in server;
2.cookie configuration
Setcookie(string name,string value ,int expire,string path,string domain,int secure);
expire:limited time;
eg.SetCookie("MyCookie","fwefwefwe",time()+3600,"/forum","evocacs.php100.com")
recieve cookie
$_COOKIE["MyCookie"];
delete cookie
SetCookie("Cookie","");
pay attention1: if you set cookie ,you should befor HTML DOC
2.Session
session_start();
$_SESSION[name]=value;
isset($_SESSION[name]);
unset($_SESSION[name]);
session_destroy();
3.cookie
if you set the cookie and you need to refresh the page :
code : <javascritp> location.href="local.php" <javascript>
相关文章推荐
- MVC、控件、一般处理程序中的session and cookie
- sessionid and cookie
- difference between Cookie and Session
- What is the difference between a Session and a Cookie?
- 【Head First Servlets and JSP】笔记13:session & cookie
- session and cookie
- cookie and session
- cookie, sessionStorage and localStorage 之间的区别 与定义和应用;
- session and cookie
- cookie and session
- Session Cookie and Persistent Cookie
- Django—Cookie and Session
- asp.net cookie and session
- Cookie Theft and Session Hijacking
- PHP7.27: Cookie and Session
- Java Session and Cookie
- Django—Cookie and Session
- Session and Cookie
- session and cookie