<?php
include "includes/security.php";

checkSession();

if (!isset($_COOKIE["hasVoted"])) {
    setcookie("hasVoted", true, time() + 60, "/");
}

addVote($_SESSION["film"], $_SESSION["voto"]);

session_destroy();
?>

<!DOCTYPE HTML>
<html lang="it">

<head>
    <title>Login</title>
    <?php require "includes/head.php" ?>
</head>

<body>

<div class="container">
    <h1>Grazie per aver votato</h1>
    <h2>Per controllare i voti controlla la pagina <a href="statistics.php">statistiche</a></h2>
</div>

<?php require "includes/footer.php" ?>

</body>
</html>

