<?php
session_start();
?>
<?php
if(isset($_SESSION['username'])){
	//Remove all session variables
	session_unset();
 
	// destroy the session
	session_destroy();  
	header("location: index.php");
}else{
	header("location: index.php");
}
?>