Answers for "php after leave page"

PHP
0

php after leave page

$_SESSION['previous'] = basename($_SERVER['PHP_SELF']);

if (isset($_SESSION['previous'])) {
   if (basename($_SERVER['PHP_SELF']) != $_SESSION['previous']) {
        session_destroy();
        ### or alternatively, you can use this for specific variables:
        ### unset($_SESSION['varname']);
   }
}
Posted by: Guest on April-24-2020

Browse Popular Code Answers by Language