PHP注销脚本无法正常工作

I have a logout script where I'm trying to clear all session data. Whenever I do this i can navigated back to any page and the variables are still being used.

<?php
session_start();
session_destroy();
header('Location: index.php');
?>

You should disable the cache on the pages that change on login

header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0 "); // Proxies.

This code is from prevent browser back button cache.