<?php

/* LOGOUT */

include('setup/config.php');
session_start();
$_SESSION['error'] = '';
$login = check_current_user_login($ARR_USERS, $SALT);
$currentuser = $login['user'];
//var_dump($currentuser); die();
if($currentuser){
    $sessionname = md5($currentuser->username.$SALT);
    $_SESSION[$sessionname] = FALSE;
}
//$sessionname = md5($USER.$SALT);
//$_SESSION[$sessionname] = FALSE;
session_unset();
session_destroy();
header('Location: index.php');
