<?php
include("connect.php");
session_start();
$type = isset($_COOKIE['type']) ? $_COOKIE['type'] : "";
$hash = isset($_COOKIE['hash']) ? $_COOKIE['hash'] : "";

if ($type == "customer" && $hash != "") {
	$query = "UPDATE CUSTOMER SET CookieExpire = NOW() WHERE CookieHash = '$hash'";	
	mysqli_query($con, $query);
}elseif ($type == "customer" && $hash != "") {
	$query = "UPDATE SALESMAN SET CookieExpire = NOW() WHERE CookieHash = '$hash'";	
	mysqli_query($con, $query);
}

session_destroy();
header("Location: login.php");
 ?>