<?php
$key = 'wx123';
//判断是否有cookie
if(empty($COOKIE)){
$tel = '17681899328';
$ssid = md5($tel+$key);
setCookie('account',$tel,time()+8640030);
setCookie('ssid',$ssid,time()+8640030);
echo 'Welcome first login ^^';
}else{
$calc_ssid = md5($_COOKIE['account']+$key);
if($calc_ssid == $_COOKIE['ssid']){
// 同意登陆
echo 'Login OK!!';
}else{
// 返回登录页重新登录
echo 'Relogin!!';
}
}
网友评论