NRPC/nrpc_site/code/exit_handle.php
2021-06-28 01:45:20 +03:00

14 lines
No EOL
463 B
PHP

<?php
if (isset($_REQUEST['exit']) && isset($_COOKIE['login'])) {
$login = $_COOKIE['login'];
$cart = $_COOKIE['cart'];
$sql = "SELECT saveCart('$login', '$cart');";
$query = mysqli_query($con, $sql);
unset($_COOKIE['cart']);
setcookie('cart', null, time() - 3600, '/');
unset($_COOKIE['login']);
setcookie('login', null, time() - 3600, '/');
unset($_COOKIE['is_admin']);
setcookie('is_admin', null, time() - 3600, '/');
}