Logout in PHP
<?php
if(isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['uname']);
header('location:login.php');
}
?>
Mr. Samy
<?php
if(isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['uname']);
header('location:login.php');
}
?>
if(isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header('location:login.php');
}
<?php
ob_start();
if (!isset($_SESSION))
session_start();
unset($_SESSION['user_id']);
session_destroy();
header("location:index.php");