I Have php logout page. when user click in logout link See this page and redirect to index page. but when click in back button i see previouse page with user data. of course when i refresh page i dont see previouse page and data. i checked other code ( drupal ) after click logout and click back button i dont see previouse page and see login page. Where is my problem. how to fixed this ?
LOGOUT PAGE :
if (isset($_GET['req']) && $_GET['req'] == 'logout') {
session_start();
session_destroy();
header("Location: index.php");
exit();
}
Thanks
The code is right. Actually you don't need to prevent people clicking on the back button. If you really think this is important you could save a cookie or something else in logout.php and the main page checks with AJAX whether this cookie is set. And if it is you could reload the page with JS (and of course unset the cookie then). But a really safe way doesn't exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With