<?php
// If Invalid Login then kickout user
function getOut(){
  setcookie('Google_SLKA', '', time() - 3600, '/');
  header("Location:login.php");
  exit;
}
if (isset($_COOKIE['Google_SLKA'])) {
  $user_recent_key_update = $_COOKIE['Google_SLKA'];

  $get_user_data = showAllttdata("admin_user", "WHERE admin_security_key =  '$user_recent_key_update' and admin_status = 'active'");

  // Check if data was found
  if (count($get_user_data) > 0) {
    foreach ($get_user_data as $the_user);
  }else {
    getOut();
  }
}else {
  getOut();
}
?>
