session 失效的问题,通过js window.open() 新地址后、打开新的选项卡、php header 跳转后都会导致session的值的丢失。
解决方法:
session_write_close(); //关闭会话,去除session阻塞 session_start(); //开启会话 $_SESSION['account']=$u['email']; //赋值 $_SESSION['uid']=$u['id']; header("Location:../../iphp.php"); //跳转后退出这个脚本的运行 exit;