<?php

/* Start the PHP Session */
session_start();

/* Include the database connection file (remember to change the connection parameters) */
require '../../db_inc.php';

/* Include the Account class file */
require '../classes/account_class.php';
require_once '../php/classes/Auth.php';

/* Create a new Account object */
$account = new Account();



try
{
	if (isset($jwt_secret)) {
		$auth = new Auth((string)$jwt_secret);
		$auth->clearCookie();
	}
	$account->logout();
	$_SESSION['loggedin'] = FALSE;
	header('Location: ../login.php');
	
	die();
}
catch (Exception $e)
{
	echo $e->getMessage();
	die();
}

// Redirect to the login page:
header('Location: ../login.php');
