cookis 设置,读取方法,跨域[二级域名]

作者:袖梨 2022-06-25

cookis 设置,读取方法,跨域[二级域名]
$time =30;
$domain ='.111com.net';
setcookie("abcde","aaaaaa");//最简单的cookie设置方法

setcookie('load','www.111com.net',time()+3600*24,'/','.111com.net'); //这里可以设置二级域名
$cookis = $_COOKIE['loadDomain'];//读取域名
print_r( $cookis );
/*

来看几个例子:

简单的:

SetCookie("MyCookie", "Value of MyCookie");

带失效时间的:

SetCookie("WithExpire", "Expire in 1 hour", time()+3600);//3600秒=1小时

什么都有的:

SetCookie("FullCookie", "Full cookie value", time()+3600, "/forum", ".111com.net", 1);
*/


?>


//php教程 cookies

//asp教程 cookies

Response.Cookies("Uto")("UtorName")=UtorName
Response.Cookies("Uto")("UtorPwd")=UtorPwd
Response.Cookies("Uto").Domain="utoper.com"
Response.Cookies("Uto").Secure =False

相关文章

精彩推荐