Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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']);
   }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #leave #page
ADD COMMENT
Topic
Name
7+4 =