Home  >  Article  >  Backend Development  >  关于sessin的释放和注销有关问题

关于sessin的释放和注销有关问题

WBOY
WBOYOriginal
2016-06-13 11:42:311238browse

关于sessin的释放和注销问题
为了解决Session Fixation 的问题,想要在用户登录后清除当前的session 后在重新分配新的session。写了如下代码测试。 


  echo "登錄前".session_id();
    session_unset();//註銷內存的session
   session_destroy();//刪除服務器上的session文件
   session_start();
  $_SESSION['Login'] = md5("c04sji4jo"); 
echo "登陸后".session_id();


为什前后的session id 还是一样的?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn