Added auth support and a helper script, targeting frankenphp

This commit is contained in:
markmental 2026-02-02 14:05:21 -05:00
commit 0783e08fe9
8 changed files with 655 additions and 4 deletions

20
logout.php Normal file
View file

@ -0,0 +1,20 @@
<?php
// logout.php
declare(strict_types=1);
require_once __DIR__ . '/auth.php';
auth_session_start();
header('Content-Type: application/json; charset=utf-8');
$_SESSION = [];
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();
echo json_encode(['ok' => true]);