How to skip page in PHP when user logs out

I want to end my previous page when the end user clicks the LogOut or Back button of the browser.

+3
source share
3 answers

If you enable this at the top of all your pages, this will require the client to always reload the content, forcing the back button to request a new copy of the page.

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

http://php.net/manual/en/function.header.php

+9
source

Destroy the session key with session_destroy();

0
source

, .

0

Source: https://habr.com/ru/post/1745431/


All Articles