<?php

   session_start();

   if(!isset($_SESSION["GSB-User"]) || $_SESSION["GSB-User"] == 0) { // cor
      $_SESSION["GSB-User"] = 0;                      // cor
      $_SESSION["GSB-Name"] = "";
      $_SESSION["GSB-Auto"] = 1;
      setcookie("GSB-User", "0", time() + 31500000, "/");  // cor
      setcookie("GSB-Auto", "1", time() + 31500000, "/");  // cor
      $_COOKIE["GSB-User"] = 0; // cor 
      $_COOKIE["GSB-Auto"] = 1;
      header("Location: server/login/login.php");
   } else {
      if(!isset($_COOKIE["GSB-User"]) || intval($_COOKIE["GSB-User"]) == 0) {
         setcookie("GSB-User", $_SESSION["GSB-User"], time() + 31500000, "/");  // cor
         setcookie("GSB-Auto", $_SESSION["GSB-Auto"], time() + 31500000, "/");  // cor
         $_COOKIE["GSB-User"] = $_SESSION["GSB-User"];
         $_COOKIE["GSB-Auto"] = $_SESSION["GSB-Auto"];
      }
   }

?>