Home > Backend Development > PHP Tutorial > 关于sessin的释放和注销问题

关于sessin的释放和注销问题

WBOY
Release: 2016-06-23 14:39:21
Original
1059 people have browsed it

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


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


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


回复讨论(解决方案)

见 session_regenerate_id 函数说明

session_regenerate_id()

       

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template