aaaaa1 / logout.php
Funybubble's picture
Upload 30 files
c7257f7 verified
raw
history blame contribute delete
442 Bytes
<?php
// Securely log out admin by clearing the refresh_token cookie and redirecting to login
setcookie('refresh_token', '', [
'expires' => time() - 3600,
'path' => '/',
'domain' => '',
'secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'),
'httponly' => true,
'samesite' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'None' : 'Strict'
]);
header('Location: admin_login.php');
exit;