SAE_web/tools/logout.php
Loris BALOCCHI cfb9825a59 Nettoyage du code, fix de petits bugs.
Co-authored-by: Charpentier Juliette <juliette.charpentier1@etu.u-pec.fr
2024-06-16 17:17:55 +02:00

28 lines
507 B
PHP

<?php
session_start();
if (isset($_COOKIE['userData'])) {
unset($_COOKIE['userData']);
setcookie('userData', '', time() - 3600, '/');
}
$_SESSION = array();
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params["path"],
$params["domain"],
$params["secure"],
$params["httponly"]
);
}
session_destroy();
header("Location: /account/login");
exit();
?>