php cookie实例
这里是用php cookie来设置用户登陆的时间与过期时间代码哦
function loginCookie($uid,$name,$group,$ip,$time)
{
global $site_domain,$login_key;
$domain = (substr($site_domain,0,4) == "www.") ? substr($site_domain,3) : ".".$site_domain;
$secure = Xxtea::encrypt($uid."|".$name."|".$group."|".$ip,$login_key);
setcookie("userId",$uid,$time+86400,"/",$domain);
setcookie("userName",$name,$time+86400,"/",$domain);
setcookie("userGroup",$group,$time+86400,"/",$domain);
setcookie("userSecure",$secure,$time+86400,"/",$domain);
}