<?php
session_start();

if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    header('Location: index');
    exit;
}

if (isset($_COOKIE['remember_login'])) {
    setcookie('remember_login', '', time() - 3600, '/', '', false, true);
}

$_SESSION = [];
session_destroy();

header('Location: ../login');
exit;
