shopping-list/public_html/php/logout.php

16 lines
390 B
PHP
Raw Normal View History

2018-10-24 15:00:27 +02:00
<?php
session_start();
include $_SESSION["docroot"].'/config/config.php';
include $_SESSION["docroot"].'/php/connect.php';
2019-05-22 10:48:09 +02:00
$deleteQuery = $mysqli->prepare('DELETE FROM `sessions` WHERE `session_id`=?;');
$deleteQuery->bind_param("s", $_COOKIE["token"]);
$deleteQuery->execute();
2018-10-24 15:00:27 +02:00
unset($_SESSION);
session_destroy();
setcookie("token", "logout", 0, "/", "");
header("Location: /../");
?>