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

WBOY
Release: 2016-06-13 11:42:31
Original
1259 people have browsed it

关于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 还是一样的?

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!