<?php session_start(); date_default_timezone_set("Asia/Calcutta"); include "db.php"; $time2 = date('Y-m-d H:i:s'); $loginHis2 = "UPDATE loginHistory SET logouTime = '$time2' where mailId = '".$_SESSION['loginUser']."' and id = '".$_SESSION['loginId']."'"; mysqli_query($conn, $loginHis2); unset($_SESSION['loginUser']); session_destroy(); header("Location: login.php"); exit; ?>