This repository has been archived on 2024-12-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
chie/public/logout.php

12 lines
278 B
PHP
Raw Permalink Normal View History

2024-12-24 10:37:16 +01:00
<?php
require_once '../startup.php';
include_once '_user.php';
$logoutToken = !empty($_GET['key']) && is_string($_GET['key']) ? $_GET['key'] : '';
if(session_active() && $logoutToken === logout_token())
destroy_session($_COOKIE['fmfauth'] ?? '');
header('Location: /');