//cookie加密 function cookie_encode($value) { $key = sha1(‘alsdfj’); //随机加密字符,可以多重加密,越复杂越好 $temp = $value ^ $key; return base64_encode($temp); } //cookie解密 function cookie_decode($value) { $key = sha1(‘alsdfj’); $temp = base64_decode($value); return $temp ^ $key; }
时间: 2024-11-05 03:12:55