<?php session_start(); if(isset($_SESSION['uname']) || isset($_SESSION['pass']) ){ if (isset($_REQUEST['logout'])) { session_unset(); session_destroy(); echo "<script>location.href = 'login.php' </script> " ; } } else { echo "<script>location.href = 'login.php' </script> " ; } ?>
if (session_status() == PHP_SESSION_NONE) { session_start(); } if(isset($_SESSION['uname']) || isset($_SESSION['pass']) ){ if (isset($_REQUEST['logout'])) { session_destroy(); } //else ... //Change the echo part to - header('Location: /login.php'); exit;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)