登录的时候设置 cookie,如:
setcookie('user_name','fufay',time()+60*60*24*30);//30天后过期然后下次用户再打开页面先读取设置的cookie,就不用再次登录了。
$user_name = $_COOKIE['user_name'];