登出按钮未清除缓存值


logout button not clearing cache values

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

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

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");
?>