<?php   
include('connection.php');
session_start();

	$Session_id=session_id();
	if($session_id != '')
	{
				$sql="UPDATE `session` SET `Logout_time`=NOW() WHERE `session_id`= '$Session_id'";
				mysqli_query($GLOBALS["___mysqli_ston"], $sql)or die('Query failed: '. mysqli_error($GLOBALS["___mysqli_ston"]));	
	}
		session_unset();
	 session_destroy(); 
	  echo"<script>location.href='index.php';</script>";	
?>
