<?php


		//get user id
	   $user_id = get_user_id();

	   $q = "UPDATE users SET online_status = '0', last_logout = NOW() WHERE user_id = '$user_id'";
	   $r = mysqli_query($dbc, $q);
	   
	   $_SESSION = array(); // delete all session variables
	   
	   session_destroy();// destroy the cookies
	   
	   //setcookie(session_name(),'',time()-180);
	   setcookie('lis','',time()-1200);
	   header("Location: gateway.php?msg=lgt");
	   
	   //exit();
 



?>