如何使在网页上点击退出登录后,清除session呢?求教

WBOY
Release: 2016-06-13 13:32:56
Original
1523 people have browsed it

怎么使在网页上点击退出登录后,清除session呢?求教!
function clear1(){
    $_SESSION[allow]=NULL;
  $_SESSION[auth]=NULL;
  $power[0]=NULL;
  ?>
  window.location='index.php';
}
这样子不行,开始的时,就清空了,

怎 么使点击退出以后,触发事件清空session()///session.clear();

------解决方案--------------------
将这个方法放到另一个文件中.单击事件时调用.
------解决方案--------------------

探讨

将这个方法放到另一个文件中.单击事件时调用.

------解决方案--------------------
给退出按钮传入个action=logout的GET参数,在php里就可以判断之后unset掉相关session数据或者destroy了。
------解决方案--------------------
session进行时间判定就可以了!
点击的退出的时候,进行seseion的保存时间小于当前时间!
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!