<?php

session_start();

if (isset($_GET['logout'])) {
    unset($_SESSION['username']);
    unset($_SESSION['username']);
    unset($_SESSION['user_type']);
    unset($_SESSION['user_id']);
    unset($_SESSION['admin']);
    unset($_SESSION['farm_id']);
    unset($_SESSION['array']);
}

if (!isset($_SESSION['username'])) {
    $_SESSION['array'] = array();
    header("location:login.php");
} else {
    $_SESSION['array'] = array();
    header("location:home.php");
    // var_dump($_SESSION['array']);
}
