【问题标题】:logout button not clearing cache values注销按钮不清除缓存值
【发布时间】:2016-04-08 06:52:13
【问题描述】:

我有一个 logout.php,它运行以下代码。但它并没有完全清除会话值。它会将我重定向到主页。但是当我点击后退按钮时,上一页会完美显示。我想删除缓存值。怎么做??请帮忙

<?php
session_start(); 
session_destroy();
header("location:home.php?msg=logout");
?>

【问题讨论】:

标签: php browser-cache logout


【解决方案1】:
First Check is your previous page has session_start(); because if your previous page has not this session_start(); on top your script it will loads.

now after destroying check actually session are destroyed or not.(obvious it must be destroyed.)

you can also use unset($_SESSION['var_name']); to destroy one session variable.

<?php
session_start(); 
session_destroy();
echo "<pre>";
print_r($_SESSION);
exit;
header("location:home.php?msg=logout");
?>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多